🦕 OpenAPI plugin for generating API reference docs in Docusaurus v2.
Big thanks to @sean-perkins, @techwritermat and @andremartinssw for their efforts!
Full Changelog: https://github.com/cloud-annotations/docusaurus-openapi/compare/v0.6.4...v0.7.1
Full Changelog: https://github.com/cloud-annotations/docusaurus-openapi/compare/v0.6.3...v0.6.4
Full Changelog: https://github.com/cloud-annotations/docusaurus-openapi/compare/v0.6.2...v0.6.3
High level enhancements
Docusaurus beta.14 support
// Be sure to update @docusaurus/core:
"dependencies": {
"@docusaurus/core": "2.0.0-beta.14",
// ...
}
With the release of Docusaurus beta.14 (Thanks @slorber!), we can now support configuration of webpack-dev-server
's proxy via our docusaurus-plugin-proxy
plugin.
This can be useful when you have a separate API backend development server and you want to send API requests on the same domain.
With the following, a request to /api/users
will now proxy the request to http://localhost:3001/api/users
:
// docusaurus.config.js
const config = {
plugins: [["docusaurus-plugin-proxy", { "/api": "http://localhost:3001" }]],
// ...
};
To proxy /api/users
to http://localhost:3001/users
, the path can be rewritten:
// docusaurus.config.js
const config = {
plugins: [
[
"docusaurus-plugin-proxy",
{
"/api": {
target: "http://localhost:3001",
pathRewrite: { "^/api": "" },
},
},
],
],
// ...
};
For more config options, see devServer.proxy.
Better yarn 3 support
Other enhancements and bug fixes
High level enhancements
Added support for more schema qualifiers:
- maxLength
- minLength
- maximum
- minumum
- exclusiveMaximum
- exclusiveMinimum
- pattern
Example:
slug:
type: string
description: The human-readable, unique identifier, used to identify the document.
minLength: 1
maxLength: 40
pattern: "^[a-zA-Z0-9_-]*$"
Displays:
Possible values: 1 ≤ length ≤ 40, Value must match regular expression The human-readable, unique identifier, used to identify the document. |
Other enhancements and bug fixes
High level enhancements
Docusaurus beta.13 support (Thanks @Josh-Cena!)
// Be sure to update @docusaurus/core:
"dependencies": {
"@docusaurus/core": "2.0.0-beta.13",
// ...
}
The OpenAPI info
stanza will now generate an "Introduction" page
openapi: 3.0.3
info:
title: Swagger Petstore
version: 1.0.0
description: |
This is a sample server Petstore server.
You can find out more about Swagger at
[http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/).
For this sample, you can use the api key `special-key` to test the authorization filters.
Request bodies will now render JSON Schema with the use of allOf
keywords
requestBody:
content:
description: Example request
application/json:
schema:
allOf:
- $ref: "#/components/schema/Example1"
- $ref: "#/components/schema/Example2"
Enum options will now be displayed in schema tables
Enum: Pet status in the store |
Other enhancements and bug fixes