-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documentation: MicroProfile OpenAPI 4.0 #7654
Comments
@ramkumar-k-9286 I've updated the issue with an initial draft of the new documentation sections needed for this release. Let me know if anything isn't clear (sorry it's always a bit of a mess writing asciidoc with headings in github issues which use markdown and already have headings). |
7654-Documentation-MicroProfile-OpenAPI-4.0-1 #7654
7654-Documentation-MicroProfile-OpenAPI-4.0-2 #7654
Hi Andrew @Azquelt Draft documents ready: Note: I have added the mpOpenAPI-4.0 - content in the mpOpenAPI-3.1 file. ( Though I have already created the file, you would not be able to see it on a draft site.) You can review and add comments and I will incorporate them into the new file. Please add the Regards, CC @dmuelle |
|
7654-Documentation-MicroProfile-OpenAPI-4.0-3 #7654
hi @Azquelt Suggested changes have been made. please have a look at the draft links. Note: I have added the mpOpenAPI-4.0 - content in the mpOpenAPI-3.1 file. ( Though I have already created the file, you would not be able to see it on a draft site.) You can review and add comments and I will incorporate them into the new file. Please add the Regards, CC @dmuelle |
Thanks @ramkumar-k-9286, only a few more changes:
|
7654-Documentation-MicroProfile-OpenAPI-4.0-4 #7654
Hi @Azquelt I made the suggested correction. The examples heading - I noticed that it appears on all versions - 3.1, 3.0, 2.0 - let me check with David and get back to you on this. Regards, |
7654-Documentation-MicroProfile-OpenAPI-4.0-5 #7654
Feature epic details
Operating systems
Does the documentation apply to all operating systems?
Summary
Provide a concise summary of your feature. What is the update, why does it matter, and to whom? What do 80% of target users need to know to be most easily productive using your runtime update?
OpenAPI is a standard for documenting RESTful interfaces. An OpenAPI document can be used to create user-facing API docs, as a design spec for an API to be developed or for generating client code to access the API.
MicroProfile OpenAPI automatically generates OpenAPI documentation for applicationsusing Jakarta RESTful Web Services. Application developers can add more detail to the generated documentation by adding annotations or by using the lower-level Model API to modify the document directly. End users can retrieve the final document from the server via the
/openapi
endpoint.Liberty also provides a web-based UI to browse the OpenAPI documentation and probe the API at the
/openapi/ui
endpoint.Configuration
List any new or changed properties, parameters, elements, attributes, etc. Include default values and configuration examples where relevant:
Configure the OpenAPI output version
mpOpenAPI-4.0
can output documentation in either OpenAPI 3.1 (the default) or OpenAPI 3.0 format.Configure the OpenAPI output format using the
mpOpenAPI.openAPIVersion
attribute:Example: configure output in OpenAPI 3.0 format:
Configure which applications and modules are included in the OpenAPI documentation
The applications to be included can be controlled using these subelements of
<mpOpenAPI>
:<includeApplication>
<excludeApplication>
<includeModule>
<excludeModule>
Additional detail and examples to be added here
These configuration options are available in
mpOpenAPI-2.0
and later, starting with 24.0.0.12.By default:
mpOpenAPI-4.0
includes all deployed applicationsConfigure the
info
section of the OpenAPI documentationThe
info
section can be overridden using the<info>
subelement of<mpOpenAPI>
.This is often used when including multiple applications which each have a different
info
section.Updates to existing topics
To update existing topics, specify a link to the topics that are affected. Include a copy of the current text and the exact text to which it will change. For example: Change ABC to XYZ
We're making quite large changes to the OpenAPI documentation, so consider these first drafts.
Changes to https://openliberty.io/docs/latest/documentation-openapi.html
ADD Supported OpenAPI versions (after "The design-first approach")
The MicroProfile OpenAPI feature generates structured documentation according to the OpenAPI specification, with each new version of the OpenAPI specification updating the format of the structured documentation. Different versions of the MicroProfile OpenAPI support different versions of the OpenAPI specification.
|===
|Feature | OpenAPI versions supported
|
mpOpenAPI-4.0
| 3.1, 3.0
|
mpOpenAPI-3.1
| 3.0
|
mpOpenAPI-3.0
| 3.0
|
mpOpenAPI-2.0
| 3.0
|
mpOpenAPI-1.1
| 3.0
|
mpOpenAPI-1.0
| 3.0
|===
When using a feature which supports more than one version of the OpenAPI specification, you can switch between them with configuration. You might need to do this if you or your end users use tools or libraries to consume the documentation which don't yet support a newer version of the OpenAPI specification.
Example: select OpenAPI v3.0 when using
mpOpenAPI-4.0
REPLACE Multiple application and multi-module application support with MicroProfile OpenAPI
When multiple applications, or applications with more than one web module are deployed to the same Open Liberty server, the behaviour differs between MicroProfile OpenAPI feature versions.
|===
|Feature |Behavior
|
mpOpenAPI-4.0
|By default, all deployed applications and modules are included in the structured documentation. This can changed through configuration.
|
mpOpenAPI-2.0
tompOpenAPI-3.1
|By default, only the first web module of the first application deployed is included in the structured documentation. This can be changed through configuration.
|
mpOpenAPI-1.0
tompOpenAPI-1.1
|Only the first web module of the first application deployed is included in the structured documentation. This cannot be changed.
|===
For MicroProfile OpenAPI 2.0 and later, the applications and modules included in the structured documentation can be controlled using the
<includeApplication>
,<excludeApplication>
,<includeModule>
and<excludeModule>
elements within the [<mpOpenAPI>
configuration element].For example, to include all of the deployed applications and modules in the generated structured documentation when using
mpOpenAPI-2.0
, add the following configuration to yourserver.xml
.For example, to include all of the deployed applications and modules except for the "admin" module of "application1", add the following configuration to your
server.xml
:Notes:
name
attribute when the application is deployed in server.xml using<application>
,<webApplication>
or<enterpriseApplication>
:dropins
or thename
attribute is not specified, the name defaults to the archive filename with the extension removed.It is also possible to override the
info
section of the OpenAPI document using configuration:This may be useful when documenting multiple modules or applications because the
info
section would otherwise be replaced with a standard one that just says that the documentation from several modules was merged.Configuring multiple application and multi-module support using MicroProfile Config
The modules and applications to be included in the structured documentation can also be configured using MicroProfile Config with the following limitations:
server.xml
, the MP Config configuration will be ignored<variable>
elements.The following table lists MicroProfile Config properties that can be specified to configure which modules or applications are included in the generated OpenAPI documentation.
<<existing table with "default value" column removed>>
Notes:
application.xml
orweb.xml
). If there is no deployment descriptor or it does not specify a name, the name is the application archive filename with the extension removed.Changes to existing feature pages (
mpOpenAPI-2.0
-3.1
)REPLACE Configure OpenAPI documentation for a multi-module application
By default only the first module of the first application deployed is included in the OpenAPI documentation, but you can configure the Microprofile OpenAPI feature to merge OpenAPI documentation for multiple applications or modules into a single document.
For example, the following configuration is for the
sample_app
application which consists of anEAR
file with five web modules.<includeApplication>
element specifies that all applications are included in the final OpenAPI document<excludeModule>
elements exclude themodule-3
andmodule-5
web modules<info>
element sets theinfo
section for the final OpenAPI document, which documents web modules 1, 2 and 4For more information, see [Multiple application and multi-module application support with MicroProfile OpenAPI]
Create a new topic
To create a topic, specify a first draft of the topic that you want added and the section in the navigation where the topic should go.
New feature page for
mpOpenAPI-4.0
Copy from
mpOpenAPI-3.1
but...REPLACE Configure OpenAPI documentation for a multi-module application
Note this example is similar but not identical to the example for 2.0-3.1
By default all deployed applications and modules are included in the OpenAPI documentation, but you can configure which applications and modules should be included.
For example, the following configuration is for the
sample_app
application which consists of anEAR
file with five web modules.<excludeModule>
elements exclude themodule-3
andmodule-5
web modules<info>
element sets theinfo
section for the final OpenAPI document, which documents web modules 1, 2 and 4For more information, see [Multiple application and multi-module application support with MicroProfile OpenAPI]
The text was updated successfully, but these errors were encountered: