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

Improve API validation so openapi.yaml file utilizes schemas from API model Python classes #3575

Open
Kami opened this issue Jul 17, 2017 · 1 comment
Assignees

Comments

@Kami
Copy link
Member

Kami commented Jul 17, 2017

We need to improve / fix API validation so all the inputs are correctly validated based on the schema defined in openapi.yaml / API model.

Right now we have schemas from API models copy and pasted to openapi.yaml file and that's a maintenance nightmare (things will get out of sync, etc.).

We need to decide which place we want as an authoritative source (either API model Python classes or openapi.yaml file) and then write a generator which either writes schema to openapi.yaml file based on API model class definitions or vice-versa.

See #3573 (comment) for context.

@Kami Kami added this to the 2.4.0 milestone Jul 17, 2017
@Kami
Copy link
Member Author

Kami commented Jul 17, 2017

I would personally prefer to use API model as authoritative source, because:

  • We already have a process which generates final openapi.yaml file based on the Jinja template definition.
  • API model schemas definitions are already used in other places - e.g. when content comes into the system outside API (via st2-register-content).

If we want with the other approach, we would then have multiple files which are auto-generated and I would prefer to limit auto-generation to openapi file.

@Kami Kami self-assigned this Jul 17, 2017
@arm4b arm4b removed this from the 2.4.0 milestone Jul 6, 2020
cognifloyd added a commit that referenced this issue Aug 12, 2022
There are a lot of issues, so we're only partially validating the spec
now. We still validate with prance, but skip checking x-api-model
because there are so many legacy issues.

I looked at adding the x-api-model ... but wow, we haven't been adding
that for a long time. And there are open issues about it:
#3575
#3788

So, we just make it possible, but optional, to run the schema validation.
cognifloyd added a commit that referenced this issue Aug 12, 2022
There are a lot of issues, so we're only partially validating the spec
now. We still validate with prance, but skip checking x-api-model
because there are so many legacy issues.

I looked at adding the x-api-model ... but wow, we haven't been adding
that for a long time. And there are open issues about it:
#3575
#3788

So, we just make it possible, but optional, to run the schema validation.
cognifloyd added a commit that referenced this issue Aug 18, 2022
There are a lot of issues, so we're only partially validating the spec
now. We still validate with prance, but skip checking x-api-model
because there are so many legacy issues.

I looked at adding the x-api-model ... but wow, we haven't been adding
that for a long time. And there are open issues about it:
#3575
#3788

So, we just make it possible, but optional, to run the schema validation.
cognifloyd added a commit that referenced this issue Aug 18, 2022
There are a lot of issues, so we're only partially validating the spec
now. We still validate with prance, but skip checking x-api-model
because there are so many legacy issues.

I looked at adding the x-api-model ... but wow, we haven't been adding
that for a long time. And there are open issues about it:
#3575
#3788

So, we just make it possible, but optional, to run the schema validation.
cognifloyd added a commit that referenced this issue Aug 19, 2022
There are a lot of issues, so we're only partially validating the spec
now. We still validate with prance, but skip checking x-api-model
because there are so many legacy issues.

I looked at adding the x-api-model ... but wow, we haven't been adding
that for a long time. And there are open issues about it:
#3575
#3788

So, we just make it possible, but optional, to run the schema validation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants