cancel
Showing results for 
Search instead for 
Did you mean: 

Any solution to generate sibling element for $ref?

Highlighted
Member

Any solution to generate sibling element for $ref?

Hello, 

      I am using Open API 3.0 to generate swagger for documentation and for client code generation. For this purpose, I want to add description tag on $ref, so that underlying object can be used at multiple places. 

e.g.

Home:
type: object
properties:
home_address:
description: its the home address
$ref: '#/components/schemas/Address'

Office:
type: object
properties:
office_address:
description: its the office address
$ref: '#/components/schemas/Address'

Found this solution https://github.com/OAI/OpenAPI-Specification/issues/556#issuecomment-192007034

But cannot generate this programmatically, by adding any annotation in Java.

I am using https://github.com/swagger-api/swagger-core/blob/master/modules/swagger-maven-plugin/README.md

If this cannot be generated, what is the alternative solution?

 

Thanks in advance.

-Avanti

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors
Top Kudoed Posts