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

Handle OpenAPI Enums #51

Open
fabianmue opened this issue Sep 15, 2022 · 1 comment
Open

Handle OpenAPI Enums #51

fabianmue opened this issue Sep 15, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@fabianmue
Copy link

The OpenAPI 3.0 spec allows to define enums: https://swagger.io/docs/specification/data-models/enums/

An example of such an enum in .json format looks like this:

"Propertyname": { "enum": [ "A", "B" ], "type": "string" },

Currently, if the input swagger.json contains such enums, the generation fails:

...\node_modules\@verizonconnect\ngx-form-generator\dist\generator-lib.js:52
    const fields = Object.keys(definition.properties);
                          ^

TypeError: Cannot convert undefined or null to object

It would be nice if the generator could handle .json files with such inputs (for example skip over them).

If you agree, I can maybe submit a PR.

@martinmcwhorter martinmcwhorter added the bug Something isn't working label Oct 16, 2022
@martinmcwhorter
Copy link
Contributor

Yes, please submit a PR for this.

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

No branches or pull requests

2 participants