Hi I was trying to import swagger in Dev Portal but in our payload we have multiple attribute with same name:
"faultCharacteristics": [{ "type": "TroubleCode", "value": "ULL" }, { "type": "Workable", "value": "No" }, { "type": "AssociateOutage", "value": "No" } ],
As of now when we import the swagger in Smart Doc of Dev Portal, it is having only one attribute pair :
faultCharacteristics: type: object properties: type: type: string default: TroubleCode description: >- Used to identify the problem faced by the service. Possible values TroubleCode, Workable, AssociateOutage, ACVoltage, OpenIn, ServiceNeverWorked, RequestedTask, DiagnosticTestId. value: type: string default: ULL description: >- 'Value of the identified parameter. Possible values are based on the type. TroubleCode NSY 'Workable : Yes/No' 'AssociateOutage: Yes/No' 'ACVoltage: Yes/No' 'OpenIn: Yes/No' 'ServiceNeverWorked: Yes/No' 'RequestedTask: Appointment/Commitment/Tester' 'DiagnosticTestId: 107828' 'Trouble Code listed is example code only. https://sdev.telstra. com/content/trouble-ticket-api-supporting-materials#TW Create Input Guidelines'.
Please suggest @yuriyl , @Anil Sagar , @Diego Zuluaga , @Gordon Rogers
Change your spec like this
faultCharacteristics: type: object properties: type: type: string default: TroubleCode description: >- Used to identify the problem faced by the service. Possible values TroubleCode, Workable, AssociateOutage, ACVoltage, OpenIn, ServiceNeverWorked, RequestedTask, DiagnosticTestId. value: type: string default: ULL description: >- 'Value of the identified parameter. Possible values are based on the type. TroubleCode NSY 'Workable : Yes/No' 'AssociateOutage: Yes/No' 'ACVoltage: Yes/No' 'OpenIn: Yes/No' 'ServiceNeverWorked: Yes/No' 'RequestedTask: Appointment/Commitment/Tester' 'DiagnosticTestId: 107828' 'Trouble Code listed is example code only. https://sdev.telstra. com/content/trouble-ticket-api-supporting-materials#TW Create Input Guidelines'. faults: type: object properties: faultCharacteristics: type: array items: $ref:'#/definitions/faultCharacteristics'
This should give you the desired result
Hi @snehal chakraborty thanks for replying .
Please can you elaborate your solution as i am not able to understand what we i have to.
Basically we want multiple default value :
faultCharacteristics: type: array properties: type: items: type: string default: TroubleCode, description: >- Used to identify the problem faced by the service. Possible values TroubleCode, Workable, AssociateOutage, ACVoltage, OpenIn, ServiceNeverWorked, RequestedTask, DiagnosticTestId. value: type: string default: ULL description: >- 'Value of the identified parameter. Possible values are based on the type. TroubleCode NSY 'Workable : Yes/No' 'AssociateOutage: Yes/No' 'ACVoltage: Yes/No' 'OpenIn: Yes/No' 'ServiceNeverWorked: Yes/No' 'RequestedTask: Appointment/Commitment/Tester' 'DiagnosticTestId: 107828' 'Trouble Code listed is example code only. https://sdev.telstra. com/content/trouble-ticket-api-supporting-materials#TW Create Input Guidelines'. type: items: type: string default: WorkForce, description: >- Used to identify the problem faced by the service. Possible values TroubleCode, Workable, AssociateOutage, ACVoltage, OpenIn, ServiceNeverWorked, RequestedTask, DiagnosticTestId. value: type: string default: NILL description: >- 'Value of the identified parameter. Possible values are based on the type. TroubleCode NSY 'Workable : Yes/No' 'AssociateOutage: Yes/No' 'ACVoltage: Yes/No' 'OpenIn: Yes/No' 'ServiceNeverWorked: Yes/No' 'RequestedTask: Appointment/Commitment/Tester' 'DiagnosticTestId: 107828' 'Trouble Code listed is example code only. https://sdev.telstra. com/content/trouble-ticket-api-supporting-materials#TW Create Input Guidelines'.
Here you can see that we have 2 values of "type", so how can we achieve this without getting error "duplicated mapping key"
type: string
default: TroubleCode, and type: string default: WorkForce,
User | Count |
---|---|
6 | |
2 | |
1 | |
1 | |
1 |