Open podhmo opened 3 years ago
the one of expected output.
from __future__ import annotations
import typing
class Attachment:
"""
An object representing a container instance or task attachment.
"""
details: typing.Optional[typing.List[KeyValuePair]]
id: typing.Optional[str]
status: typing.Optional[str]
type: typing.Optional[str]
class KeyValuePair:
"""
A key-value pair object.
"""
name: typing.Optional[str]
value: typing.Optional[str]
ah, something like that..
"value": {
"allOf": [
{
"$ref": "#/components/schemas/String"
},
{
"description": "The value of the key-value pair. For environment variables, this is the value of the environment variable."
}
]
}
also
"TagResourceResponse": {
"example": {},
"properties": {},
"type": "object"
},
diff --git a/metashape/inputs/openapi/__init__.py b/metashape/inputs/openapi/__init__.py
index a135b05..980fad7 100644
--- a/metashape/inputs/openapi/__init__.py
+++ b/metashape/inputs/openapi/__init__.py
@@ -225,7 +225,7 @@ class Resolver:
typ = d.get("type", None)
if typ in cand:
return True
- if self.has_allof(d):
+ if self.has_allof(d) and all("type" in x or "$ref" in x for x in d["allOf"]):
return True
return False
https://gist.github.com/podhmo/729fd8b50cd5b6d8c9fe15520a26ee96