-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
7654-Documentation-MicroProfile-OpenAPI-4.0-1
7654-Documentation-MicroProfile-OpenAPI-4.0-1 #7654
- Loading branch information
1 parent
5934e4e
commit a16b237
Showing
5 changed files
with
214 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,33 +5,35 @@ | |
|
||
// This example only applies to 2.0 forward, and so the file and directory must be manually copied and applied to any new versions. Copy the directory and file and change the directory name to reflect the new feature version, for example `mpOpenAPI-3.2`. | ||
|
||
You can specify xref:ROOT:external-configuration.adoc[MicroProfile Config] properties to configure the Microprofile OpenAPI feature to merge OpenAPI documentation for multiple applications or modules into a single document. | ||
By default, only the first module of the first deployed application is included in the OpenAPI documentation. However, you can configure the MicroProfile OpenAPI feature to merge the OpenAPI documentation for multiple applications or modules into a single document. | ||
|
||
In the following `microprofile-config.properties` file example, an OpenAPI document is configured for the `sample_app` application, which consists of an `EAR` file with five web modules. | ||
For example, the following configuration is for the `sample_app` application, which consists of an `EAR` file containing five web modules. | ||
|
||
[source,java] | ||
[source,xml] | ||
---- | ||
mp.openapi.extensions.liberty.merged.include=all | ||
mp.openapi.extensions.liberty.merged.exclude=sample_app/module-3,sample_app/module-5 | ||
mp.openapi.extensions.liberty.merged.info= | ||
{ | ||
"title": "A multi-module sample application", | ||
"description": "This is a sample application.", | ||
"termsOfService": "http://example.com/sample_app/terms", | ||
"contact": { | ||
"name": "API Support", | ||
"url": "http://www.example.com/sample_app/support", | ||
"email": "[email protected]" | ||
}, | ||
"license": { | ||
"name": "License 2.0", | ||
"url": "https://www.example.org/licenses/LICENSE-2.0.html" | ||
}, | ||
"version": "2.0.1" | ||
} | ||
<mpOpenAPI> | ||
<includeApplication>all</includeApplication> | ||
<excludeModule>sample_app/module-3</excludeModule> | ||
<excludeModule>sample_app/module-5</excludeModule> | ||
<info title="A multi-module sample application" | ||
description="This is a sample application." | ||
version="2.0.1" | ||
termsOfService="http://example.com/sample_app/terms" | ||
contactName="API Support" | ||
contactUrl="http://www.example.com/sample_app/support" | ||
contactEmail="[email protected]" | ||
licenseName="License 2.0" | ||
licenseUrl="https://www.example.org/licenses/LICENSE-2.0.html" | ||
/> | ||
</mpOpenAPI> | ||
---- | ||
* The `mp.openapi.extensions.liberty.merged.include` property specifies that all five modules are included in the final OpenAPI document. | ||
* The `mp.openapi.extensions.liberty.merged.exclude` overrides the `mp.openapi.extensions.liberty.merged.include` property to exclude the `module-3` and `module-5` web modules. | ||
* The `mp.openapi.extensions.liberty.merged.info` property sets the `info` section for the final OpenAPI document, which documents web modules 1, 2, and 4. | ||
|
||
- The `<includeApplication>` element specifies that all applications are included in the final OpenAPI document. | ||
|
||
- The `<excludeModule>` elements exclude the `module-3` and `module-5` web modules. | ||
|
||
- The `<info>` element sets the info section for the final OpenAPI document, which documents web modules 1, 2, and 4. | ||
|
||
For more information, see xref:ROOT:documentation-openapi.adoc#multi-module[Multiple application and multi-module application support with MicroProfile OpenAPI] | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,33 +5,33 @@ | |
|
||
// This example only applies to 2.0 forward, and so the file and directory must be manually copied and applied to any new versions. Copy the directory and file and change the directory name to reflect the new feature version, for example `mpOpenAPI-3.2`. | ||
|
||
You can specify xref:ROOT:external-configuration.adoc[MicroProfile Config] properties to configure the Microprofile OpenAPI feature to merge OpenAPI documentation for multiple applications or modules into a single document. | ||
By default, only the first module of the first deployed application is included in the OpenAPI documentation. However, you can configure the MicroProfile OpenAPI feature to merge the OpenAPI documentation for multiple applications or modules into a single document. | ||
|
||
In the following `microprofile-config.properties` file example, an OpenAPI document is configured for the `sample_app` application, which consists of an `EAR` file with five web modules. | ||
For example, the following configuration is for the `sample_app` application, which consists of an `EAR` file containing five web modules. | ||
|
||
[source,java] | ||
[source,xml] | ||
---- | ||
mp.openapi.extensions.liberty.merged.include=all | ||
mp.openapi.extensions.liberty.merged.exclude=sample_app/module-3,sample_app/module-5 | ||
mp.openapi.extensions.liberty.merged.info= | ||
{ | ||
"title": "A multi-module sample application", | ||
"description": "This is a sample application.", | ||
"termsOfService": "http://example.com/sample_app/terms", | ||
"contact": { | ||
"name": "API Support", | ||
"url": "http://www.example.com/sample_app/support", | ||
"email": "[email protected]" | ||
}, | ||
"license": { | ||
"name": "License 2.0", | ||
"url": "https://www.example.org/licenses/LICENSE-2.0.html" | ||
}, | ||
"version": "2.0.1" | ||
} | ||
<mpOpenAPI> | ||
<includeApplication>all</includeApplication> | ||
<excludeModule>sample_app/module-3</excludeModule> | ||
<excludeModule>sample_app/module-5</excludeModule> | ||
<info title="A multi-module sample application" | ||
description="This is a sample application." | ||
version="2.0.1" | ||
termsOfService="http://example.com/sample_app/terms" | ||
contactName="API Support" | ||
contactUrl="http://www.example.com/sample_app/support" | ||
contactEmail="[email protected]" | ||
licenseName="License 2.0" | ||
licenseUrl="https://www.example.org/licenses/LICENSE-2.0.html" | ||
/> | ||
</mpOpenAPI> | ||
---- | ||
* The `mp.openapi.extensions.liberty.merged.include` property specifies that all five modules are included in the final OpenAPI document. | ||
* The `mp.openapi.extensions.liberty.merged.exclude` overrides the `mp.openapi.extensions.liberty.merged.include` property to exclude the `module-3` and `module-5` web modules. | ||
* The `mp.openapi.extensions.liberty.merged.info` property sets the `info` section for the final OpenAPI document, which documents web modules 1, 2, and 4. | ||
|
||
- The `<includeApplication>` element specifies that all applications are included in the final OpenAPI document. | ||
|
||
- The `<excludeModule>` elements exclude the `module-3` and `module-5` web modules. | ||
|
||
- The `<info>` element sets the info section for the final OpenAPI document, which documents web modules 1, 2, and 4. | ||
|
||
For more information, see xref:ROOT:documentation-openapi.adoc#multi-module[Multiple application and multi-module application support with MicroProfile OpenAPI] |
Oops, something went wrong.