Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

Adding support for $ref pointers to additionalProperties #232

Merged
merged 3 commits into from
Jul 31, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 39 additions & 2 deletions example/swagger-files/additional-properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,21 @@
"type": "object",
"additionalProperties": { "type": "integer" }
},
"object with `additionalProperties: { type: array, items: { type: integer } }` (this does not work)": {
"object with `additionalProperties: { type: object, properties: ... }`": {
"type": "object",
"additionalProperties": {
"type": "object",
"properties": {
"code": {
"type": "integer"
},
"text": {
"type": "string"
}
}
}
},
"object with `additionalProperties: { type: array, items: { type: integer } }`": {
"type": "object",
"additionalProperties": {
"type": "array",
Expand All @@ -38,11 +52,17 @@
}
}
},
"object with `additionalProperties: $ref` (this does not work)": {
"object with `additionalProperties: $ref, simple`": {
"type": "object",
"additionalProperties": {
"$ref": "#/components/schemas/ref"
}
},
"object with `additionalProperties: $ref, with $ref`": {
"type": "object",
"additionalProperties": {
"$ref": "#/components/schemas/ref-with-ref"
}
}
}
}
Expand All @@ -56,6 +76,23 @@
"schemas": {
"ref": {
"type": "integer"
},
"ref-with-ref": {
"type": "object",
"properties": {
"code": {
"type": "integer"
},
"text": {
"type": "string"
},
"array": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ref"
}
}
}
}
}
}
Expand Down
Loading