Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generation: add overwriteable type names #214

Open
wizzardich opened this issue May 6, 2024 · 2 comments
Open

Generation: add overwriteable type names #214

wizzardich opened this issue May 6, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@wizzardich
Copy link
Contributor

Current Behaviour

Given the following spec:

components:
  messages:
    EventSuccess:
      payload:
        type: object
        properties:
          event_id:
            type: integer
            description: The id of the event
            x-go-name: EventID 

The produced output will have the generated type:

> asyncapi-codegen -i asyncapi.yml -g types -o gen.gen.go
// EventSuccessMessagePayload is a schema from the AsyncAPI specification required in messages
type EventSuccessMessagePayload struct {
	// Description: The id of the event
	EventId *int64 `json:"event_id"`
}

Desired Behaviour

The x-go-name directive is respected, the same way oapi-codegen does here

type EventSuccessMessagePayload struct {
	// Description: The id of the event
	EventID *int64 `json:"event_id"`
}

Notes

@lerenn
Copy link
Owner

lerenn commented May 7, 2024

Hello @wizzardich ! Thanks for taking the time to open the issues !

I'm on vacation until next week, so I may have not a lot of time, but I'll review everything ASAP :)

@lerenn lerenn added the enhancement New feature or request label May 7, 2024
@wizzardich
Copy link
Contributor Author

It's a bit busy for me as well right now, but I'll try to get to it in coming weeks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants