Skip to content

Conversation

@ConorPKeegan
Copy link
Contributor

This PR ensures that the docstring comment names are set using x-go-name so that they actually match the Go name.

Currently, it would generate this as shown in the test:

// ReferenceToRenameMe When a Schema is renamed, $ref should refer to the new name
 type ReferenceToRenameMe struct {
        // ToNewName This schema should be renamed via x-go-name when generating
        NewName NewName `json:"ToNewName"`
 }

Whereas, it should instead show this:

// ReferenceToRenameMe When a Schema is renamed, $ref should refer to the new name
 type ReferenceToRenameMe struct {
        // NewName This schema should be renamed via x-go-name when generating
        NewName NewName `json:"ToNewName"`
 }

@jamietanna jamietanna added the bug Something isn't working label Feb 10, 2024
Copy link
Member

@jamietanna jamietanna left a comment

Choose a reason for hiding this comment

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

Thanks very much!

@jamietanna jamietanna merged commit 327e62e into oapi-codegen:master Feb 10, 2024
danicc097 pushed a commit to danicc097/oapi-codegen that referenced this pull request Aug 31, 2024
Right now, prefixes to Go Doc strings use the generated type name, not
the name that's overridden by the `x-go-name` extension.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants