Skip to content

Commit

Permalink
Move some common content to a shared file; add discussion of Helidon-…
Browse files Browse the repository at this point in the history
…specific config settings to MP OpenAPI doc (#3954)
  • Loading branch information
tjquinno committed Mar 16, 2022
1 parent e0d280d commit 784e61b
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 15 deletions.
9 changes: 7 additions & 2 deletions docs/mp/openapi/01_openapi.adoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
///////////////////////////////////////////////////////////////////////////////

Copyright (c) 2019, 2021 Oracle and/or its affiliates.
Copyright (c) 2019, 2022 Oracle and/or its affiliates.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -33,6 +33,7 @@
:feature-name: MicroProfile OpenAPI
:common-deps-page-prefix-inc: ../../shared/dependencies/common_shared.adoc
:microprofile-bundle: true
:common-openapi-doc: ../../shared/openapi/openapi-shared.adoc
Easily allow your Helidon MP application to serve an OpenAPI document
that describes your application's endpoints.
Expand Down Expand Up @@ -173,10 +174,14 @@ class name of your class.
=== Update your application configuration
Beyond the two config properties that denote the model reader and filter, Helidon
MP OpenAPI supports a number of others. These are described in the
MP OpenAPI supports a number of other mandated settings. These are described in the
link:{mp-openapi-spec}#configuration[configuration section] of the MicroProfile
OpenAPI spec.
include::{common-openapi-doc}[common-config]
Assign these settings in `META-INF/microprofile-config.properties`.
== Accessing the OpenAPI document
Now your Helidon MP application will automatially respond to an additional endpoint --
`/openapi` -- and it will return the OpenAPI document describing the endpoints
Expand Down
16 changes: 3 additions & 13 deletions docs/se/openapi/01_openapi.adoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
///////////////////////////////////////////////////////////////////////////////

Copyright (c) 2019, 2021 Oracle and/or its affiliates.
Copyright (c) 2019, 2022 Oracle and/or its affiliates.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -32,6 +32,7 @@
:filter-java: {mp-openapi-prefix}/api/src/main/java/org/eclipse/microprofile/openapi/OASFilter.java
:feature-name: OpenAPI
:common-deps-page-prefix-inc: ../../shared/dependencies/common_shared.adoc
:common-openapi-doc: ../../shared/openapi/openapi-shared.adoc
Easily allow your Helidon SE application to serve an OpenAPI document
that describes your application's endpoints.
Expand Down Expand Up @@ -155,18 +156,7 @@ servers for given operations
|===
For more information on what these settings do consult the MicroProfile OpenAPI spec.
Helidon SE also supports additional properties.
.Helidon SE-specific OpenAPI Config Properties
|===
|Property |Use
|`openapi.web-context` |Path which serves the OpenAPI document (defaults to `/openapi`)
|`openapi.static-file` |Full path to the static OpenAPI file (defaults to
`META-INF/openapi.yml`,
`META-INF/openapi.yaml`, or
`META-INF/openapi.json`)
|===
include::{common-openapi-doc}[common-config]
Set these config properties in one of the config sources your app uses so the
Helidon config system will load them. Often developers use `application.yaml` at the
Expand Down
31 changes: 31 additions & 0 deletions docs/shared/openapi/openapi-shared.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
///////////////////////////////////////////////////////////////////////////////

Copyright (c) 2022 Oracle and/or its affiliates.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

///////////////////////////////////////////////////////////////////////////////
// tag::common-config[]
Helidon {h1Prefix} also supports additional properties specific to Helidon.
.Helidon-specific OpenAPI Config Properties
|===
|Property |Use
|`openapi.web-context` |Path which serves the OpenAPI document (defaults to `/openapi`)
|`openapi.static-file` |Full path to the static OpenAPI file (defaults to
`META-INF/openapi.yml`,
`META-INF/openapi.yaml`, or
`META-INF/openapi.json`)
|===

0 comments on commit 784e61b

Please sign in to comment.