strongbugman / apiman Goto Github PK
View Code? Open in Web Editor NEWApi document support for any python web framework
License: BSD 3-Clause "New" or "Revised" License
Api document support for any python web framework
License: BSD 3-Clause "New" or "Revised" License
Using the flask extension via
from apiman.flask import Extension
spec_path = "openapi.yml"
openapi = Extension(template=spec_path, decorators=(lambda f: f,))
openapi.init_app(app)
...
with this openapi.yml
file
openapi: 3.0.0
servers:
- url: 'http://localhost'
info:
version: 0.0.1
title: Run it
paths:
/run:
post:
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/RunDocument'
responses:
'200':
description: Success
components:
schemas:
RunDocument:
type: object
required:
- Prices
properties:
Prices:
$ref: '#/components/schemas/PriceTimeseries'
PriceTimeseries:
type: array
items:
$ref: '#/components/schemas/PriceRecord'
PriceRecord:
type: object
required:
- Timestamp
properties:
Timestamp:
type: number
description: Unix Epoch in seconds
leads to
where the RunDocument
is composed correctly, but the TimeSeries
wrongly says it is composed of TimeSeries
(should be PriceRecord
) although the tooltip shows the correct schema #components/schemas/PriceRecord
.
Am I missing something?
I.e. if i have authenticated API, that uses JWT token, is there a way to have it enabled using apiman?
{
"openapi": "3.0.1",
"info": {
"title": "Example app",
"description": "Application home page",
"version": "v2"
},
"securitySchemes": {
"JWT": {
"type": "http",
"scheme": "bearer",
"bearerFormat": "<JWT>"
}
}
}
For example having this template, can i have the authorization button on the swagger page? Like in the screenshot below?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.