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

Create rule format for JSON schema files #571

Closed
rossmcdonald opened this issue Sep 18, 2019 · 4 comments · Fixed by #575
Closed

Create rule format for JSON schema files #571

rossmcdonald opened this issue Sep 18, 2019 · 4 comments · Fixed by #575
Assignees
Labels
enhancement New feature or request

Comments

@rossmcdonald
Copy link
Contributor

I believe there is only support today for OpenAPI formats. We should also allow users to run rules against JSON schema formats (or just generic objects, whichever is easiest).

The context here is that we need to allow Studio users to run rules on JSON schema files. I was thinking we could allow users to set a format attribute (json-schema, for example) on the rule to have it target JSON schema models.

@philsturgeon
Copy link
Contributor

You can lint any files not just OpenAPI, it could be asyncapi, agithub actuon yaml Cole, anything at all. Where did this request come from?

@rossmcdonald
Copy link
Contributor Author

@philsturgeon This is in the context of Spectral running within Studio. Isn't there a "format" designation set on rules based on which type of file they should be run against (ie, oas2, oas3)? Are there other formats that I'm just not aware of?

@rossmcdonald
Copy link
Contributor Author

BTW I've also opened https://github.com/stoplightio/studio/issues/122 since I didn't know exactly where the change would be needed. If this is just in Studio then we can close this one. I wasn't sure if we needed to add support for a new file format type or not.

@philsturgeon
Copy link
Contributor

AHA! Ok, so stuff will run against all formats by default. We added formats for oas2 and oas3 only so people could run certain rules on a specific version, but if you run a ruleset against a JSON Schema file it’ll work. I’m not sure what studio does with this.

@P0lip P0lip self-assigned this Sep 20, 2019
@P0lip P0lip added the enhancement New feature or request label Sep 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants