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

alias types change on every generation #614

Open
mdesousa opened this issue Sep 14, 2024 · 0 comments
Open

alias types change on every generation #614

mdesousa opened this issue Sep 14, 2024 · 0 comments

Comments

@mdesousa
Copy link

we have some dependencies to not-exported types in our json schema. these types get an "alias" name in the generated json schema that changes every time the types are re-generated. this results in a lot of unnecessary changes that make it hard to review changes in source control.

it would be nice if the alias could be generated with a hash that was the same on every generation. maybe a hash that takes the name of the type as an input?

here is an example:

type A = { a: string };
export type B = Partial<A>;

when the json schema is generated you get this:

...
"Partial<alias-117779449-275-301-117779449-0-826>": { "type": "object", "properties": { "a": { "type": "string" } } },
"B": { "$ref": "#/definitions/Partial<alias-117779449-275-301-117779449-0-826>" },
...

this is ok, but if you commit this to source control and regenerate (without changes) you get different alias values.

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

No branches or pull requests

1 participant