oapi-codegen
oapi-codegen copied to clipboard
operationId value is capitalized in compiled schema
Hello,
I have a schema that has operationId: foobar as follows.
openapi: 3.0.3
info:
title: Example
version: 1.0.0
paths:
/foo/bar/{param}:
parameters:
- in: path
name: param
schema:
type: string
required: true
get:
summary: example
operationId: foobar
I wanted to look up the operation in Go with the operation ID foobar,
but found that the compiled schema has Foobar instead.
func main() {
t, _ := example.GetSwagger()
for _, item := range t.Paths.Map() {
if item.Get == nil {
continue
}
fmt.Println(item.Get.OperationID)
}
}
Run the above program showed:
Foobar
Is this an intended behavior?