Solved
Forum Discussion
HKosova
SmartBear Alumni (Retired)
Can you please post your entire "components" section with all schemas?
kashira
3 years agoNew Contributor
G'day Helen,
Thanks so much for spending time to help me with this. I posting the complete yml.
openapi: 3.0.0 info: title: Customers API description: Customer resource version: 1.0.0 contact: name: Raj email: Rajendra.Kashi@gmail.com paths: /customers: get: description: to retireve all the customer detail summary: This route retrieves all the customer detail responses: 200: description: retieves all the customer information content: application/json: schema: $ref: '#/components/schemas/CustomersRetrieveResponse' /customers/{customer_id}: get: description: retrieve customer summary: This route retrieve customer by customer id parameters: - in: path name: customer_id required: true description: customer id schema: type: string responses: 200: description: retieves all the customer information content: application/json: schema: $ref: '#/components/schemas/CustomerRetrieveResponse' post: description: create customer summary: This route retrieves all the customer detail requestBody: required: false content: application/json: schema: $ref: '#/components/schemas/CustomerCreateRequest' responses: 200: description: Description content: application/json: schema: type: string components: schemas: CustomersRetrieveResponse: type: array items: $ref: '#/components/schemas/CustomerRetrieveItem' CustomerRetrieveResponse: $ref: '#/components/schemas/CustomerRetrieveItem' CustomerCreateRequest: $ref: '#/components/schemas/CustomerCreateItem' CustomerCreateItem: required: - first_name - last_name allOf: - $ref: '#/components/schemas/CustomerTitleWithDefault' - $ref: '#/components/schemas/CustomerBasicData' CustomerRetrieveItem: allOf: - $ref: '#/components/schemas/CustomerId' - $ref: '#/components/schemas/CustomerTitle' - $ref: '#/components/schemas/CustomerBasicData' CustomerBasicData: type: object properties: first_name: type: string last_name: type: string CustomerId: type: object properties: id: type: string CustomerTitleWithDefault: allOf: - $ref: '#/components/schemas/CustomerTitle' default: Unknown #type: object #properties: # title: # type: string # enum: # - Mr # - Mrs # - M/S # - Dr # - Unknown # default: Unknown CustomerTitle: type: object properties: title: type: string enum: - Mr - Mrs - M/S - Dr - Unknown |
Thanking you,
Raj
Related Content
Recent Discussions
- 5 days agoankkashyap