mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-18 20:57:06 +00:00
[python-nextgen] better enum naming (#14869)
* better handling of enum naming in python nextgen * remove unused import * update samples * update samples * map dot
This commit is contained in:
@@ -61,6 +61,7 @@ docs/Pig.md
|
||||
docs/ReadOnlyFirst.md
|
||||
docs/SelfReferenceModel.md
|
||||
docs/SingleRefType.md
|
||||
docs/SpecialCharacterEnum.md
|
||||
docs/SpecialModelName.md
|
||||
docs/SpecialName.md
|
||||
docs/StoreApi.md
|
||||
@@ -135,6 +136,7 @@ petstore_api/models/pig.py
|
||||
petstore_api/models/read_only_first.py
|
||||
petstore_api/models/self_reference_model.py
|
||||
petstore_api/models/single_ref_type.py
|
||||
petstore_api/models/special_character_enum.py
|
||||
petstore_api/models/special_model_name.py
|
||||
petstore_api/models/special_name.py
|
||||
petstore_api/models/tag.py
|
||||
|
||||
@@ -180,6 +180,7 @@ Class | Method | HTTP request | Description
|
||||
- [ReadOnlyFirst](docs/ReadOnlyFirst.md)
|
||||
- [SelfReferenceModel](docs/SelfReferenceModel.md)
|
||||
- [SingleRefType](docs/SingleRefType.md)
|
||||
- [SpecialCharacterEnum](docs/SpecialCharacterEnum.md)
|
||||
- [SpecialModelName](docs/SpecialModelName.md)
|
||||
- [SpecialName](docs/SpecialName.md)
|
||||
- [Tag](docs/Tag.md)
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
# SpecialCharacterEnum
|
||||
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
@@ -88,6 +88,7 @@ from petstore_api.models.pig import Pig
|
||||
from petstore_api.models.read_only_first import ReadOnlyFirst
|
||||
from petstore_api.models.self_reference_model import SelfReferenceModel
|
||||
from petstore_api.models.single_ref_type import SingleRefType
|
||||
from petstore_api.models.special_character_enum import SpecialCharacterEnum
|
||||
from petstore_api.models.special_model_name import SpecialModelName
|
||||
from petstore_api.models.special_name import SpecialName
|
||||
from petstore_api.models.tag import Tag
|
||||
|
||||
@@ -67,6 +67,7 @@ from petstore_api.models.pig import Pig
|
||||
from petstore_api.models.read_only_first import ReadOnlyFirst
|
||||
from petstore_api.models.self_reference_model import SelfReferenceModel
|
||||
from petstore_api.models.single_ref_type import SingleRefType
|
||||
from petstore_api.models.special_character_enum import SpecialCharacterEnum
|
||||
from petstore_api.models.special_model_name import SpecialModelName
|
||||
from petstore_api.models.special_name import SpecialName
|
||||
from petstore_api.models.tag import Tag
|
||||
|
||||
@@ -31,6 +31,6 @@ class EnumClass(str, Enum):
|
||||
"""
|
||||
|
||||
ABC = '_abc'
|
||||
EFG = '-efg'
|
||||
XYZ = '(xyz)'
|
||||
MINUS_EFG = '-efg'
|
||||
LEFT_PARENTHESIS_XYZ_RIGHT_PARENTHESIS = '(xyz)'
|
||||
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by: https://openapi-generator.tech
|
||||
"""
|
||||
|
||||
|
||||
from inspect import getfullargspec
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
from aenum import Enum, no_arg
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
class SpecialCharacterEnum(str, Enum):
|
||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||
Ref: https://openapi-generator.tech
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
"""
|
||||
allowed enum values
|
||||
"""
|
||||
|
||||
ENUM_456 = '456'
|
||||
ENUM_123ABC = '123abc'
|
||||
UNDERSCORE = '_'
|
||||
SPACE = ' '
|
||||
AMPERSAND = '&'
|
||||
DOLLAR = '$'
|
||||
GREATER_THAN_EQUAL = '>='
|
||||
THIS_IS_EXCLAMATION = 'this_is_!'
|
||||
IMPORT = 'import'
|
||||
HELLO_WORLD = ' hello world '
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by: https://openapi-generator.tech
|
||||
"""
|
||||
|
||||
|
||||
from __future__ import absolute_import
|
||||
|
||||
import unittest
|
||||
import datetime
|
||||
|
||||
import petstore_api
|
||||
from petstore_api.models.special_character_enum import SpecialCharacterEnum # noqa: E501
|
||||
from petstore_api.rest import ApiException
|
||||
|
||||
class TestSpecialCharacterEnum(unittest.TestCase):
|
||||
"""SpecialCharacterEnum unit test stubs"""
|
||||
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
def tearDown(self):
|
||||
pass
|
||||
|
||||
def testSpecialCharacterEnum(self):
|
||||
"""Test SpecialCharacterEnum"""
|
||||
# inst = SpecialCharacterEnum()
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user