-
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
Hi @Azquelt I made the suggested correction. Regards, |
7654-Documentation-MicroProfile-OpenAPI-4.0-6 #7654
Peer review
Supported OpenAPI versions
Multiple application and multi-module application support with MicroProfile OpenAPIWhen multiple applications, or applications with more than one web module are deployed to the same Open Liberty server, the behavior differs between MicroProfile OpenAPI feature versions This can changed through configuration. --> rewrite this sentence and similar ones so that it has a subject other than "this" Configuring multiple application and multi-module support
This is confusing- are you configuring API docs or the application deployment? Does this option require certain app definitions in the server.xml? Why might someone choose this option over the "easy" alternative of using MP config? These examples already exist on the feature page- we should just point there. If the examples on the feature page arent sufficient, we can rework them
Which file name?
Configure using the MicroProfile Config---> Configure using MicroProfile Config properties
this needs more detail- system properties can be set in jvm.properties or bootstrap.properties file. Environment variables in server.env. As written it looks like all are set in server.xml |
Hi @dmuelle, I see your feedback and I've talked to @ramkumar-k-9286 about the proposed changes and I have a couple of concerns. Firstly, I need to let you know that having the MicroProfile Config options for this feature was a mistake. It's a problem for a couple of reasons:
The only reason the MicroProfile Config options exist today is for backward compatibility so this page should push people towards configuration via server.xml.
I'm worried that if we remove all the config examples from this page, the part about configuration via server.xml becomes one line and the part about MP Config properties is several paragraphs and a big table, which makes MP Config seem like the more important option. I'm not against moving the examples, but I would want to ensure that the page pushes people towards configuring this feature with server.xml. Within the examples, I think the most commonly used one will be how to include all applications on <mpOpenAPI>
<includeApplication>all</includeApplication>
</mpOpenAPI> Outside of this, I don't expect many users to need to use the
The text "Naming applications and modules" has been made into a header again (previously it was "Notes:" for the preceding examples). If this has to be a header, you need another header at this level before the next paragraph describing the use of
This is true - I deliberately wrote the table in a redundant way because when I talk about this feature, it confuses everyone that MP OpenAPI 4.0 supports OpenAPI 3.1. By making the table redundant like this, I think it makes it more clear that we've been using OpenAPI 3.0 in every version since MP OpenAPI 1.0, and the OpenAPI version is not linked in any way to the feature version. I'm happy to be overruled on this if you think a concise table would be more helpful, but I wanted to communicate why I wrote it like that. |
Thanks @Azquelt for this context. A few thoughts - If the mpconfig is only for backward compatibility- we already document these properties on the MicroProfile Config properties page. Instead of documenting them explicitly here, why not just have a sentence that points to that table. Keep in mind that users of earlier versions can still select those versions in the doc and see all the config examples we've previously had relevant to those versions. We can also emphasize server.xml config as the best option, mp config just for compatibility with earlier versions Then we can structure the examples on the feature pages in a logical way, with descriptive headings, and only show the examples that are relevant to each particular version. For the supported versions table- we can restore the previous table. |
7654-Documentation-MicroProfile-OpenAPI-4.0-7 #7654
7654-Documentation-MicroProfile-OpenAPI-4.0-8 #7654
7654-Documentation-MicroProfile-OpenAPI-4.0-9 #7654
7654-Documentation-MicroProfile-OpenAPI-4.0-010 #7654
7654-Documentation-MicroProfile-OpenAPI-4.0-011 #7654
I'm not happy with how the docs here have turned out and so I'm removing the developer reviewed tag. I think this is reasonable given how much has changed since I approved them. Here are the issues with the current docs:
Now, I'll be honest, I just dumped out of my brain everything I know needs to be documented for this feature and arranged it into what I thought was a sensible order for someone to read. If we have a strategy for how our docs are supposed to fit together that says things like "no examples on concept pages", can you link me to that so I can try to arrange what I know needs to be there into something resembling a sensible order that fits within that framework? |
Hi Andrew- I've updated the draft to restore the content that was moved out of the topic. We need to align on something at least for the 240012 release and the doc freeze is tomorrow. Hopefully this is closer to what you were thinking: In general, the OL docs strategy is to put feature-related configuration on the feature pages, in concise examples with descriptive headings, and to avoid edge cases or multiple equivalent ways of doing the same thing, so the majority users can quickly find the information that they need to accomplish a specific goal. Concept topics help users understand the intention and logic of a given feature, then they decide what they want to configure and select the corresponding resource. Users shouldn't need to click between all the possible combinations of topics. For instance, I dont think the user should need the full OpenAPI configuration element reference table to learn how to configure their multi-module OpenAPI documentation, but it might be useful if they are looking at a server.xml file and then want to quickly look up what a certain element or attribute does. This of course is the ideal and there are plenty of exceptions :) The guiding principle is really progressive disclosure- insofar as possible, only show the user the information they need to accomplish their goal. No one user needs all the possible options, so when you put everything into one topic, you often give everyone more things they have to ignore and make the whole task seem more complicated than it actually is. In general, users don't want to know "What is everything I can possibly do with x feature?" but instead "How can I quickly get x job done?" Applied in this case, users who want to configure multimodule documentation would read the basic conceptual details, then self-select whether they want to see more detailed content about the specific feature version or config method they choose, instead of having to parse through the whole range of details about every option. Then they click through to the version of the feature they are using for a detailed configuration example that is specific to that version and its defaults. It might be that the previous draft was not serving this goal very well, but that's the logic behind it. |
Thanks David, I think this is much better for now, and we can look to improve it after this release so that it better matches the desired structure. I noticed a few typos:
|
7654-Documentation-MicroProfile-OpenAPI-4.0-012 #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: