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

Load 3.0 spec with missing required fields #485

Open
f0rt opened this issue Feb 3, 2022 · 1 comment
Open

Load 3.0 spec with missing required fields #485

f0rt opened this issue Feb 3, 2022 · 1 comment

Comments

@f0rt
Copy link

f0rt commented Feb 3, 2022

Hey team,
Is it possible to load a specification that has some missing required fields. I'm getting error when I use the LoadFromData() method. I'm working in a large company with hundreds of specs. Most of them fail basic validation but I had to load the model(information like paths, descriptions) to generate docs. :/

@fenollp
Copy link
Collaborator

fenollp commented Feb 3, 2022

There is no way to deserialize a document that's missing required fields without failing right now.
Turning every field into omitempty to solve this is non trivial as code assumes these fields exist.

I understand there's hundred of specs (and that you're working at a large company...) but I suggest short term you write a script to edit the JSON/YAML and stub out the missing fields.

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

2 participants