Class: module:"openapi-transformers/remove-ref-siblings.js"

module:"openapi-transformers/remove-ref-siblings.js"()

Transformer to remove properties from Reference Objects. OpenAPI Specification 2.0 and 3.0 forbid properties other than $ref on Reference Object. OAS 3.1 relaxed the restriction to allow summary and description on all Reference Objects and all properties on Schema Objects (due to changes in the referenced version of JSON Schema). There is discussion of allowing more: https://github.com/OAI/OpenAPI-Specification/issues/2026 https://github.com/OAI/OpenAPI-Specification/issues/2498 Note: Autorest supports description, title, readonly, nullable, and x-* properties: https://github.com/Azure/autorest/blob/main/docs/openapi/howto/$ref-siblings.md

Constructor

new module:"openapi-transformers/remove-ref-siblings.js"()

Source:

Methods

removeSchemaRefProp(propName, schemanon-null) → {boolean}

Should a property on a Schema Object with $ref be removed?
Parameters:
Name Type Description
propName string Name of the property.
schema object Schema Object.
Source:
Returns:
true if propName should be removed, otherwise false.
Type
boolean