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

Commit

Permalink
Adding support for $ref pointers to additionalProperties (#232)
Browse files Browse the repository at this point in the history
* Adding some more additionalProperties examples to the example spec.

* Moving our react-jsonschema-form fork to a different repo and branch.

* Moving react-jsonschema-form back to dist-committed.
  • Loading branch information
erunion authored Jul 31, 2019
1 parent eed011f commit 3ee2fcc
Show file tree
Hide file tree
Showing 3 changed files with 625 additions and 30 deletions.
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

0 comments on commit 3ee2fcc

Please sign in to comment.