Comments (9)
I checked it myself - it isn't supported. For us it's a showstopper because we have lots of maps in our API
from pyswagger.
Interesting, I didn't see that property shown in the spec of Swagger 2.0. Let's me check how it works.
from pyswagger.
Just found I asked similar question in Google Groups....
I tend to provide a partial support on additionalProperties for your case.
The problem is, this property contains 2 different types of value: a boolean or a Schema object.
To support what you need, I just need to support additionalProperties with a Schema object, which is easier.
The boolean case would be resolved later but not now, is that OK?
You could check the progress in this branch https://github.com/mission-liao/pyswagger/tree/addp
from pyswagger.
Here is the testing case I would use in this case, let me know if this is not what you expected.
{
"swagger":"2.0",
"host":"http://test.com",
"basePath":"/v1",
"paths":{
},
"definitions":{
"Category":{
"properties":{
"id":{
"type":"integer",
"format":"int64"
},
"name":{
"type":"string"
}
}
},
"add_prop":{
"properties":{
"name_of_map":{
"type":"string"
}
},
"additionalProperties":{
"$ref":"#/definitions/Category"
}
}
}
}
from pyswagger.
Just to confirm, following JSON should fit your schema:
{
"name_of_map": "my map",
"prop1": {
"id": 1,
"name": "property 1"
},
"prop2": {
"id": 2,
"name": "property no. 2"
},
}
If so, it's exactly what I need.
BTW could I also define additionalProperties inline (as opposed to using $ref)?
from pyswagger.
Sure, it will works when inlined.
from pyswagger.
Just create a PR, will be merged once we finished your PR.
from pyswagger.
Just merge to master, will give a new build once Json_Reference is done.
from pyswagger.
Just update a new build on pypi, you could verify this issue with new build.
For adding support on type:'number' or 'integer' without format, I gonna provide some way for users to register their own primitive handlers.
from pyswagger.
Related Issues (20)
- Attribute error while making a request with swagger spec 2.0 HOT 2
- Unable to access api/v2/openapi.yaml HOT 1
- Way to 'post' request programmatically
- pyswagger.App has no __create__ method
- Incorrect URL for Travis for build status widget
- url_scheme does not respect selected scheme when loading from local file.
- ValueError: invalid obj passed <class 'list'> from spec/base.py
- Normalize URLs before executing request HOT 1
- Change from pop to get when patching requests
- Parsing error?
- Issue with Basic authentication HOT 1
- requests.Session is not properly closed
- How to upload file? HOT 1
- Accept a urllib.requests.Request instead of a string in App.load HOT 2
- Default values shall not be automatically employed in requests
- Allow lenient loading of the API HOT 1
- What is the future of pywagger ? HOT 4
- Should use yaml.safe_load() HOT 1
- 2 arguments needed in create function HOT 1
- Python 3.10 removed `MutableMapping` from `collections` HOT 3
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 pyswagger.