John Bush c4f0521e10 Fix escaped regex values in Python client (#1517). (#1539)
* Fix escaped regex values in Python client (#1517).

* Override PythonClientCodegen toRegularExpression() method to correct
  issue with backslashes being escaped. This issue was a result of
  calling escapeText() in the parent DefaultCodegen class.

* Only escape unescaped forward slashes in PythonClientCodegen.

* Override addRegularExpressionDelimiter in PythonClientCodegen.java
  such that only unescaped forward slashes in the pattern get escaped.
* Adds a new test resource .yaml file for specifically testing this
  issue.

* Check for regular expression modifiers in PythonClientCodegen.

* Adds check in postProcessPattern() in PythonClientCodegen.java to
  check if regular expression has modifiers defined. If so, it throws an
  exception as modifiers are not currently supported in the Python
  client.

* PythonClientCodegen warns that regex modifiers are not supported.

* Changes behavior in PythonClientCodegen.java to no longer throw an
  IllegalArgumentException in the case that a pattern contains
  modifiers. A warning message will be logged instead stating that
  modifiers are not currently supported by the codegen class.

* Remove warning for PythonClientCodegen regex modifier support.

* Removes warning message from PythonClientCodegen.java stating that
  regular expression modifiers are not currently supported. Further
  code review and testing revealed that this feature is already
  supported and working.

* Add updated Python client sample files.
2018-12-08 11:32:55 +08:00

41 lines
1.4 KiB
Python

# coding: utf-8
"""
OpenAPI Petstore */ ' \" =end -- \\r\\n \\n \\r
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ */ ' \" =end -- # noqa: E501
OpenAPI spec version: 1.0.0 */ ' \" =end -- \\r\\n \\n \\r
Contact: something@something.abc */ ' \" =end -- \\r\\n \\n \\r
Generated by: https://openapi-generator.tech
"""
from setuptools import setup, find_packages # noqa: H301
NAME = "petstore-api"
VERSION = "1.0.0"
# To install the library, run the following
#
# python setup.py install
#
# prerequisite: setuptools
# http://pypi.python.org/pypi/setuptools
REQUIRES = ["urllib3 >= 1.15", "six >= 1.10", "certifi", "python-dateutil"]
setup(
name=NAME,
version=VERSION,
description="OpenAPI Petstore */ ' \" =end -- \\r\\n \\n \\r",
author_email="something@something.abc */ ' \" =end -- \\r\\n \\n \\r",
url="",
keywords=["OpenAPI", "OpenAPI-Generator", "OpenAPI Petstore */ ' \" =end -- \\r\\n \\n \\r"],
install_requires=REQUIRES,
packages=find_packages(),
include_package_data=True,
long_description="""\
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ */ ' \" =end -- # noqa: E501
"""
)