oapi-codegen does not generate response objects the way I expect:
Here is my endpoint:
"/v5.2/items": {
"get": {
"operationId": "ItemsController_getItems",
"summary": "List of items available in the system",
"parameters": [],
"responses": {
"200": {
"description": "All supported items",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"items": {
"type": "object",
"properties": {
"item1": {
"$ref": "#/components/schemas/ItemDetail"
}
}
}
}
}
}
}
}
},
"tags": ["General"]
}
}
When I run oapi-codegen -generate types, I would expect there to be a response object created like this:
type ItemsResponse struct {
Items map[string]ItemDetail `json:"items"`
}
But right now, only ItemDetail is being created and I am manually creating the proper response object myself.
oapi-codegendoes not generate response objects the way I expect:Here is my endpoint:
When I run
oapi-codegen -generate types, I would expect there to be a response object created like this:But right now, only
ItemDetailis being created and I am manually creating the proper response object myself.