tobilg / api2html Goto Github PK
View Code? Open in Web Editor NEWA CLI tool to transform Swagger/OpenAPI/AsyncAPI docs to beautiful HTML pages via Shins/Widdershins.
License: MIT License
A CLI tool to transform Swagger/OpenAPI/AsyncAPI docs to beautiful HTML pages via Shins/Widdershins.
License: MIT License
Let's say that I have a schema defined in my OpenAPI spec:
user:
properties:
id:
type: string
format: uuid
login:
type: string
format: email
password:
type: string
format: password
I would expect in the generated HTML to include only the properties, so basically this:
{
"id": {
"type": "string",
"format": "uuid"
},
"login": {
"type": "string",
"format": "email"
},
"password": {
"type": "string",
"format": "password"
},
}
However, it is rendering with the higher level fields:
{
"type": "object",
"properties": {
"id": {
"type": "string",
"format": "uuid"
},
"login": {
"type": "string",
"format": "email"
},
"password": {
"type": "string",
"format": "password"
}
}
}
You can also see this happening the example you link to in the README: https://tobilg.github.io/api2html/petstore/#schemas
When converting, running this on our yaml spec, we have a few code examples that when converted to html are not encoding new lines and are outputting as a single line with a bunch of \n .
Hi
I am using this tool to generate a swagger 2 api document, but I cannot see any Restrictions in the generated html.
I added minLength, maxLength, I think these are restrictions.
Is this a bug? Can you give some suggestions for this problem?
Hey there!
Just trying this out on a project I am firing up and it's working pretty great!
One requirement I have is to add some custom CSS (or even Sass). Currently the customCss flag appears to be a boolean value of true, which is passed through to shins.
According to the shins docs
Setting customCss to true will include the pub/css/screen_overrides.css,pub/css/print_overrides.css and pub/css/theme_override.css files, in which you can override any of the default Slate theme, to save you from having to alter the main css files directly. This should make syncing up with future Shins / Slate releases easier.
But we don't have any way to access these files as they are in node_modules using this tool.
How do I inject customCss?
Thanks!
combining schemas in path is not working
e.g.
paths:
/pets:
patch:
requestBody:
content:
application/json:
schema:
oneOf:
- $ref: '#/components/schemas/Cat'
- $ref: '#/components/schemas/Dog'
but it's working in
components:
schemas:
...
Hello! First of all, thanks for this awesome package! It's just so really helpful in producing excellent API documentation.
I just wanted to reach out to ask if there's a way I can append the form-data params to the curl examples. Right now, requestBody that are of multi-part form data and application/json content types show in the curl samples if httpsnippet and experimental options are hardcoded to true, but not params with x-www-form-urlencoded content-type. Any help is much appreciated.
Thank you in advance!
Hi Tobi:
Thanks for maintaining this project!
I see reason to add several new arguments to pass on to shins.render() like, layout, etc. and maybe a verbose option to log which options were recognized and being passed on to the converter and the renderer. Any/all would be helpful.
In looking at the command line argument definitions, in the current version, you have two -s options, although the -- options are different. That might be worth fixing.
Also, do you when the current version would be synced with npm? Seems like the customcss option isn't out there yet.
Thanks,
Matt
I am trying to use the --theme option.
I cant see any error but i cant see any visual difference.
Where is my error?
api2html -o ./dist/api.html --languages http,javascript,javascript--nodejs --theme idea ./dist/api.yaml
Thank you
I noticed the customLogoUrl
CLI option isn't available on the NPM package that is published. Just curious when this might be available.
Thanks!
Is there a way to specify a Widdershins config file, used by --environment
? There are a number of things that would be nice to specify and have passed on to Widdershins without having to have api2html
support every single thing Widdershins supports.
Hello,
Since you merged our PRs, don't forget to update/republish the npm package.
Cheers :)
edit: my bad on the error, -theme needs to be --theme
Also, it's not clear if there's a way to change the .toc-wrapper / dark parts of the theme? I'm assuming "theme" is just the middle section?
Hello!
Thank you for this great project.
Is it possible to generate examples for Typescript? (eg. -l typescript)
Greetings!
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.