kogosoftwarellc / open-api

A Monorepo of various packages to power OpenAPI in node
MIT License
892 stars 235 forks source link

[openapi-types]: SchemaObject interface doesn't have `$ref` in V2 #537

Open RunningCoderLee opened 5 years ago

RunningCoderLee commented 5 years ago

https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#schemaObject

The SchemaObject interface doesn't have $ref property

https://github.com/kogosoftwarellc/open-api/blob/30a6a91349d122ae38b9faea210d3ec969cca29c/packages/openapi-types/index.ts#L524

Maybe DefinitionsObject interface and properties in SchemaObject interface should use Schema ?

https://github.com/kogosoftwarellc/open-api/blob/30a6a91349d122ae38b9faea210d3ec969cca29c/packages/openapi-types/index.ts#L430

emerikool commented 3 years ago

I have similar issue on IJchemaSchema interface when using allOf property that also can be a $ref. https://github.com/kogosoftwarellc/open-api/blob/ceb1a04a6b245dd0a2ef1f3c149a88082aa2cb73/packages/openapi-types/index.ts#L653

Adding $ref?: string; property to IJchemaSchema interface will fix both issues.