Comments (2)
Below is the file I parse
{
"apiVersion": "2.0",
"swaggerVersion": "1.2",
"basePath": "https://api.pocketmath.com/",
"resourcePath": "isps",
"apis": [
{
"path": "v2/isps.json",
"operations": [
{
"summary": "List supported ISP's.",
"type": "ISP",
"parameters": [
{
"paramType": "query",
"name": "q",
"type": "string",
"description": "String to search ISP names by.",
"required": false
},
{
"paramType": "query",
"name": "country_code",
"type": "string",
"description": "ISO-3166-1 country code to filter ISP by.",
"required": false
},
{
"paramType": "query",
"name": "page",
"type": "number",
"description": "Page number of results.",
"required": false
}
],
"responseMessages": [
{
"code": 401,
"responseModel": null,
"message": "Unauthorized"
},
{
"code": 403,
"responseModel": null,
"message": "Forbidden"
}
],
"method": "get",
"nickname": "Api::V2::Isps#index"
}
]
}
],
"authorizations": {
"apiKey": {
"type": "apiKey",
"scopes": [
{
"scope": "isps",
"description": "Access to your email address"
}
],
"passAs": "header",
"keyname": "Authorization"
}
},
"models":{
"ISP": {
"id": "ISP",
"properties": {
"id": {
"type": "integer",
"format": "int64"
},
"name": {
"type": "string"
},
"country_code": {
"type": "string"
}
}
}
}
}
from pyswagger.
I guess this document is an API Declaration in swagger 1.2, so I cooked a minimal Resource Listing as below, and place this document in right folder to verify your issue
{
"swaggerVersion":"1.2",
"apis":[
{"path":"/v2/isps"}
],
"apiVersion":"2.0",
"info":{
"title":"",
"description":""
}
}
In swagger 1.2, the detailed authorization info should be declared in 'Resource Listing', and only scopes(for oauth2) in 'API Declaration'.
In your cases, the 'Authorizations' should be replaced to your 'Resource Listing' file. In this API declaration part, it should only have these stuffs:
{
"authorizations":{
"apiKey":[]
}
}
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.