Comments (1)
The reason is about json format, you can not change line in a string which is a member of list.
>>> json.loads('{\n "sku_id": "123",\n "user_id": [\n "aaaassssddd"\n ]\n}')
{'sku_id': '123', 'user_id': ['aaaassssddd']}
>>> json.loads('{\n "sku_id": "123",\n "user_id": [\n "aaaas\nsssddd"\n ]\n}')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/hsw/.pyenv/versions/3.6.0/lib/python3.6/json/__init__.py", line 354, in loads
return _default_decoder.decode(s)
File "/home/hsw/.pyenv/versions/3.6.0/lib/python3.6/json/decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/home/hsw/.pyenv/versions/3.6.0/lib/python3.6/json/decoder.py", line 355, in raw_decode
obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Invalid control character at: line 4 column 11 (char 46)
So if you want to pass a string contain control character, use double slash like this
>>> json.loads('{\n "sku_id": "123",\n "user_id": [\n "aaaas\\nsssddd"\n ]\n}')
{'sku_id': '123', 'user_id': ['aaaas\nsssddd']}
from swagger-py-codegen.
Related Issues (20)
- sanic下的bp会将__name__做成url_prefix,请问这个是本意就如此设计吗? HOT 1
- Schema Definitions Are Not Deterministically Ordered HOT 1
- Nested self reference to a definition, results in circular dependency error
- PyYAML 3.13 HOT 1
- Only generates demo>v1>schemas.py HOT 1
- jinja2.exceptions.UndefinedError: 'schemas' is undefined
- TypeError when use swagger HOT 2
- unexpected keyword argument 'spec' HOT 3
- Type Error: Unexpected Keyword Argument 'swagger' HOT 1
- name "RefResolver" is not defined HOT 2
- FileNotFoundError: [Errno 2] No such file or directory: 'api.yml'?
- AttributeError exception while generating code
- TypeError exception in response validation with falcon framework
- conversion failed HOT 1
- UnicodeDecodeError HOT 1
- Help
- ImportError: attempted relative import with no known parent package
- can not generate file upload in swagger html??
- use 0.0.0.0 instead 127.0.0.1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from swagger-py-codegen.