alexjomin / openapi-parser

Simple and still naive openapi documentation generator from comments of your Go code.
18 stars 8 forks source link

Parser should use custom schema name instead of type name #30

Closed Sadzeih closed 3 years ago

Sadzeih commented 4 years ago
// @openapi:schema:CustomName
type RegularType struct {
 // properties
}

// openapi:schema
type Response {
    Data RegularType `json:"data"`
}

we will get

Response:
    type: object
    properties:
        data:
            $ref: '#/components/schemas/RegularType'
CustomName:
    type: object
    properties:
        # properties

Here the ref in Response should be #/components/schemas/CustomName