Skip to content

Fix incorrect fieldname reserved keywords in path parameters (strict server)#999

Merged
deepmap-marcinr merged 1 commit intooapi-codegen:masterfrom
reinkrul:reserved-keywords-bug
Mar 14, 2023
Merged

Fix incorrect fieldname reserved keywords in path parameters (strict server)#999
deepmap-marcinr merged 1 commit intooapi-codegen:masterfrom
reinkrul:reserved-keywords-bug

Conversation

@reinkrul
Copy link
Copy Markdown
Contributor

Fixes #993

When generating a strict server interface for an operation that contains a path parameter (e.g. type), which is named after a Go keyword, the generated code is invalid.

It generated:

request.PType = pType

Which should've been:

request.Type = pType

This PR fixes that.

@deepmap-marcinr deepmap-marcinr merged commit 0d7287e into oapi-codegen:master Mar 14, 2023
@deepmap-marcinr
Copy link
Copy Markdown
Contributor

Thank you.

@reinkrul reinkrul deleted the reserved-keywords-bug branch March 15, 2023 05:33
adrianpk pushed a commit to foorester/oapi-codegen that referenced this pull request Jan 16, 2024
adrianpk pushed a commit to foorester/oapi-codegen that referenced this pull request Jan 16, 2024
adrianpk added a commit to foorester/oapi-codegen that referenced this pull request May 31, 2024
adrianpk added a commit to foorester/oapi-codegen that referenced this pull request May 31, 2024
danicc097 pushed a commit to danicc097/oapi-codegen that referenced this pull request Aug 31, 2024
danicc097 pushed a commit to danicc097/oapi-codegen that referenced this pull request Aug 31, 2024
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.

Strict interface with reserved Go keywords as property yield invalid generated code

2 participants