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

Feature Request: Ability to provide custom validation ruleset #1887

Closed
ezequiel opened this issue Feb 7, 2025 · 2 comments · Fixed by #1919
Closed

Feature Request: Ability to provide custom validation ruleset #1887

ezequiel opened this issue Feb 7, 2025 · 2 comments · Fixed by #1919
Assignees
Labels
enhancement New feature or request openapi_31 OpenAPI 3.1 related issue
Milestone

Comments

@ezequiel
Copy link
Contributor

ezequiel commented Feb 7, 2025

Right now we default to whatever the @ibm-cloud/openapi-ruleset package gives us.

const ibmOpenapiRuleset = require('@ibm-cloud/openapi-ruleset');

spectral.setRuleset(ibmOpenapiRuleset);

Ideally we provide an alternative a way to supply our own custom ruleset if desired.

Here's the API I'm thinking of:

export default defineConfig({
  'api-client': {
    input: {
      target: 'swagger.json'

      // This can now be either a boolean (for the default ruleset), 
      // OR a path to your own custom ruleset
      validation: '../path-to-my-ruleset.json',
    },
    ....
   },
});
@melloware melloware added openapi_31 OpenAPI 3.1 related issue enhancement New feature or request labels Feb 7, 2025
@ezequiel
Copy link
Contributor Author

ezequiel commented Feb 8, 2025

@melloware feel free to assign me

@melloware melloware added this to the 7.6.0 milestone Feb 8, 2025
@melloware
Copy link
Collaborator

Done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request openapi_31 OpenAPI 3.1 related issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants