Open raphaeloliveira opened 5 years ago
Referencing a property in a Schema like that is not supported in SwagGen. I didn’t even know it was part of the open api spec. If nickname is just a string, I would just define it as such in the UpdateCardRequest, thereby duplicating the definition. I don’t think it’s necessary to make it it’s own type
Hey @yonaskolb, our backend team recently added on our openapi spec the following entry on
schemas:
A new
UpdateCardRequest
A new property called
nickname
under the existingCard
schema.When swaggen generates the code,
Card
correctly receives the newnickname
property of typeString
. However, the newUpdateCardRequest
object fails to compile due to unknown Nickname type. Apparently having a$ref
to a property (Card/properties/nickname
) does not make Swaggen generate a typealias or a new object. Is my assumption correct?As a temporary workaround I could make Nickname a new object under
schema
and have thenickname
property underCard
reference it. Thoughts?