-
Notifications
You must be signed in to change notification settings - Fork 7
Description
Summary
The goal of this issue is to improve how external schema references look when dereferenced. Currently, an external reference like this:
components:
schemas:
account:
$ref: ../models/account..s1.schema.yaml
when dereferenced looks something like this:
components:
schemas:
account:
$ref: '#/components/schemas/Account_S1_Schema'
Account_S1_Schema
title: Account
type: object
description: General Ledger Account
properties:
.
.
.
The original external reference gets replaced with a new internal reference to a new object that has a name that is derived from the external file name. It doesn't seem like it's necessary to create a new object, and it looks kind of silly. (It's functional, though.)
Instead, the external reference should just be replaced with the contents of the file that it points to:
components:
schemas:
account:
title: Account
type: object
description: General Ledger Account
properties:
.
.
.
I think this would be an improvement to external references that originate in the components/schemas
section. External references from the paths
section would need to be treated differently because a new internal schema would need to be created. In that case, I recommend using the title of the object as the object name if the schema contains a title, and only using the file name if there is no title.
Additional context
I haven't used the JSON schema ref parser in its standalone form; I've only used it by exporting from Stoplight, and Stoplight support folks told me that this is the actual source project.