Skip to content

Commit

Permalink
Merge pull request #152 from tdakkota/feat/treat-some-any-of-as-sum
Browse files Browse the repository at this point in the history
feat(gen): handle anyOf which can be represent by type sum
  • Loading branch information
tdakkota committed Feb 3, 2022
2 parents eb5784c + e593f56 commit d3f85ed
Show file tree
Hide file tree
Showing 14 changed files with 939 additions and 368 deletions.
29 changes: 29 additions & 0 deletions _testdata/sample.json
Expand Up @@ -927,6 +927,9 @@
"testAny": {
"$ref": "#/components/schemas/AnyTest"
},
"testAnyOf": {
"$ref": "#/components/schemas/AnyOfTest"
},
"testDate": {
"type": "string",
"format": "date"
Expand Down Expand Up @@ -1060,6 +1063,31 @@
}
]
},
"AnyOfTest": {
"description": "Type for testing some anyOf cases from Jaeger operator API schema",
"required": [
"medium",
"sizeLimit"
],
"properties": {
"medium": {
"type": "string"
},
"sizeLimit": {
"anyOf": [
{
"type": "integer"
},
{
"type": "string"
}
],
"pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$",
"x-kubernetes-int-or-string": true
}
},
"type": "object"
},
"OneVariantHasNoUniqueFields": {
"oneOf": [
{
Expand Down Expand Up @@ -1123,6 +1151,7 @@
"properties": {
"empty": {},
"any_map": {
"type": "object",
"additionalProperties": true
},
"any_array": {
Expand Down

0 comments on commit d3f85ed

Please sign in to comment.