-
-
Notifications
You must be signed in to change notification settings - Fork 534
Support additionalProperties: true
#1154
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
Comments
This is seems to be related to this one: #1066 |
That issue is different. In that case, the problem is that the spec doesn't specify a type for the schemas. That is, it has types defined like schemas:
Account:
properties:
balance:
type: string
description: balance in unit WEI, presented with hex string
example: '0x47ff1f90327aa0f8e'
energy:
type: string
description: energy in uint WEI, presented with hex string
example: '0xcf624158d591398'
hasCode:
type: boolean
description: whether the account has code
example: false Simply adding |
Hey @ajenkins-cargometrics, if this is still relevant, we got this feature in our fork that is kept in sync with this repository, would love you to give it a try |
In OpenAPI 3, a schema like:
Should be equivalent to a typescript type like:
However what openapi-typescript-codegen actually generates is a type like this:
That is, an object with no properties.
Additionally, OpenAPI allows combining
additionalProperties: true
with explicit property definitions. So an OpenAPI schema like this:Should result in a typescript type like:
but in fact it results in:
Desired result:
additionalProperties: true
in an object schema should result in a[key: string]: any
property in the corresponding typescript type.The text was updated successfully, but these errors were encountered: