Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Discussion options

Hey, for primitive types the generator creates a type alias:

type A = string

Is there an option or way to enforce full type?

type A string

Type aliases cannot have methods in Go and we would like to introduce some helpers. Thanks for hints.

You must be logged in to vote

Replies: 1 comment · 2 replies

Comment options

You could probably use https://github.com/oapi-codegen/oapi-codegen/blob/v2.4.1/configuration-schema.json#L191-L200 but that'll do it on a global level

It may be worth seeing if we can add an extension i.e. x-oapi-codegen-no-type-alias that can have each type/schema/property/etc with the ability to override it?

You must be logged in to vote
2 replies
@lzap
Comment options

For the record, Jamie meant this config:

---
compatibility:
  old-aliasing: true

Yeah, this is too much, aliases are useful but not for primitive types. I will look into this.

@lzap
Comment options

How about this: #1987

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.