mirror of
https://github.com/LukeHagar/redocly-cli.git
synced 2025-12-06 04:21:09 +00:00
* feat: basic merging of type tree extensions * feat: redefine type tree * feat: add oas3-schema validators redefining * fix: update test suite for custom type extension * feat: add custom rule for allOf validation in OpenAPIParameter * fix: update test suite for allOf in parameter * custom: add rule for redefined parameter * fix: update tests with type-extended files * chore: fix typo Co-Authored-By: Adam Altman <adam@rebilly.com> * fix: typo Co-Authored-By: Roman Hotsiy <gotsijroman@gmail.com> * fix: typo Co-Authored-By: Roman Hotsiy <gotsijroman@gmail.com> * api: split define/extend for typesRedefinition * fix: update lint rules * wip: update definition redefine * feat: changed rulesExtensions format to more middlewareAlike approach * fix: updated tests * fix: update tests * wip: update public API for overloading rules & refactoring * refactor: public api for getRule * feat: allow string severity levels * feat: updated public API for rules extension * feat: update config for lint rules * docs: added future todo * feat: added preloading of all definitions * feat: default enabled for custom rules * docs: update example config * fix: update test * fix: pass config to AbstractVisitor * refactoring: remove inheritance for default visitors & added helper for error messages * fix: update tests * fix: error output * update: no need in name param for custom rules * feat: add loading config manually
19 lines
568 B
JavaScript
19 lines
568 B
JavaScript
module.exports = (types) => ({
|
|
...types,
|
|
OpenAPIParameter: {
|
|
...types.OpenAPIParameter,
|
|
// enable dynamic type resolution for OpenAPIParameter and return either OpenAPIParameterWithAllOf or regular OpenAPIParameter
|
|
resolveType: (node) => (node.allOf ? 'OpenAPIParameterWithAllOf' : 'OpenAPIParameter'),
|
|
},
|
|
// define OpenAPIParameterWithAllOf
|
|
OpenAPIParameterWithAllOf: {
|
|
properties: {
|
|
allOf: 'OpenAPIParameterPartial',
|
|
},
|
|
},
|
|
// define OpenAPIParameterPartial
|
|
OpenAPIParameterPartial: {
|
|
...types.OpenAPIParameter,
|
|
},
|
|
});
|