Hello! Here is a simple exmaple of spec:
openapi: 3.0.3
components:
schemas:
queue:
type: object
properties:
ticket:
x-oapi-codegen-extra-tags:
db: ticket,merge
allOf:
- $ref: "#/components/schemas/ticket"
queue2:
type: object
properties:
ticket:
x-oapi-codegen-extra-tags:
db: ticket,merge
$ref: "#/components/schemas/ticket"
ticket:
type: object
properties:
clientName:
type: string
required:
- clientName
Here is generated code:
type Queue struct {
Ticket *Ticket `db:"ticket,merge" json:"ticket,omitempty"`
}
// Queue2 defines model for queue2.
type Queue2 struct {
Ticket *Ticket `json:"ticket,omitempty"`
}
// Ticket defines model for ticket.
type Ticket struct {
ClientName string `json:"clientName"`
}
I found a lifehack to add tags to Ticket field with help of allOf, but i expected it works without allOff. Code was generated with v.2.1.0 generator. Thanks!
Hello! Here is a simple exmaple of spec:
Here is generated code:
I found a lifehack to add tags to Ticket field with help of allOf, but i expected it works without allOff. Code was generated with v.2.1.0 generator. Thanks!