mirror of
https://github.com/jlengrand/openapi-generator.git
synced 2026-05-11 00:21:18 +00:00
fix enum support in oneof/anyof in python-nextgen (#15340)
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
"""
|
||||
|
||||
|
||||
from inspect import getfullargspec
|
||||
import json
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
from aenum import Enum, no_arg
|
||||
@@ -34,3 +34,9 @@ class StringEnumRef(str, Enum):
|
||||
FAILURE = 'failure'
|
||||
UNCLASSIFIED = 'unclassified'
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> StringEnumRef:
|
||||
"""Create an instance of StringEnumRef from a JSON string"""
|
||||
return StringEnumRef(json.loads(json_str))
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user