Skip to content

Fix/handle initial digit of operation - #735

Merged
5 commits merged into
oapi-codegen:masterfrom
masu-mi:fix/handle-initial-digit-of-operationId
Oct 27, 2022
Merged

5 commits merged into
oapi-codegen:masterfrom
masu-mi:fix/handle-initial-digit-of-operationId

Conversation

@masu-mi

@masu-mi masu-mi commented Aug 29, 2022 •

Copy link
Copy Markdown
Contributor

Overview

resolve #734

changes

  • Add example spec. files. in internal/test/issues/issue-head-digit-of-operation-id directory.
  • Change codegen.GenerateResponseDefinitions()
  • Add generated code with cd internal/test/issues/issue-head-digit-of-operation-id; go generate

@masu-mi
masu-mi force-pushed the fix/handle-initial-digit-of-operationId branch from 072d4e4 to 62817e6 Compare September 2, 2022 05:17
Comment thread pkg/codegen/operations.go
}
op.OperationID = op.OperationID
} else {
op.OperationID = ToCamelCase(op.OperationID)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see the typeNamePrefix function in utils.go - it can do something like this automatically, combined with SanitizeGoIdentity.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for delay in my response, I've replaced it.

@masu-mi
masu-mi force-pushed the fix/handle-initial-digit-of-operationId branch 3 times, most recently from 6e4f3d8 to 5f1661b Compare October 27, 2022 08:38
@ghost
ghost merged commit 40503ed into oapi-codegen:master Oct 27, 2022
adrianpk pushed a commit to foorester/oapi-codegen that referenced this pull request Jan 16, 2024
* test: internal/test/issues/issue-head-digit-of-operation-id

* fix: escape digit from head of operationId

* chore: add issue.gen.go(head-digit-of-operation-id)

* fix: use typeNamePrefix() to remove head digit

* stop direct writing for less confusion.
* cd ./internal/test; go generate ./...

* chore: make generate with go 1.16.9
adrianpk added a commit to foorester/oapi-codegen that referenced this pull request May 31, 2024
* test: internal/test/issues/issue-head-digit-of-operation-id

* fix: escape digit from head of operationId

* chore: add issue.gen.go(head-digit-of-operation-id)

* fix: use typeNamePrefix() to remove head digit

* stop direct writing for less confusion.
* cd ./internal/test; go generate ./...

* chore: make generate with go 1.16.9
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Broken code is generated when spec. includes operationId starts with digit

1 participant