oapi-codegen icon indicating copy to clipboard operation
oapi-codegen copied to clipboard

operationId value is capitalized in compiled schema

Open ymmt2005 opened this issue 1 year ago • 0 comments

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?

ymmt2005 avatar Sep 11 '24 08:09 ymmt2005