Skip to content
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

FISH-6298 Yaml result added with the explanation about 'endpoints' #53

Merged
merged 6 commits into from Aug 9, 2022
Merged
Expand Up @@ -142,6 +142,113 @@ import org.eclipse.microprofile.openapi.annotations.Operation;
}
----

Here's an example of how the OpenAPI document of a sample application would look like::
[source, yml]
----
openapi: 3.0.0
info:
title: A Test Application
version: "1.0"
servers:
- url: http://localhost:8080/openapi-example-1.0
description: Default Server.
- url: https://localhost:8181/openapi-example-1.0
description: Default Server.
paths:
/api/hello:
get:
operationId: hello-world
responses:
default:
content:
text/plain:
schema:
type: string
description: Default Response.
deprecated: false
endpoints:
/openapi-example-1.0:
- /api/hello
components: {}
----

[[deployed-endpointts]]
==== Deployed Endpoints

When more than one application is deployed, a merge is done in the OpenAPI document. The resulting document will contain all application and path definitions present. To improve the its readability, an `endpoints` attribute which lists all deployed endpoints grouped by their application context roots has been added to the document.

NOTE: The `endpoints` attribute is an proprietary Payara Platform extension and it's not portable.

The following example shows an OpenAPI document generated when 2 different applications are deployed::
[source, yml]
----
openapi: 3.0.0
info:
title: Deployed Resources
version: 1.0.0
servers:
- url: http://localhost:8080/ClusteredSingleton
description: Default Server.
- url: https://localhost:8181/ClusteredSingleton
description: Default Server.
- url: http://localhost:8080/SimpleWAR
description: Default Server.
- url: https://localhost:8181/SimpleWAR
description: Default Server.
paths:
/resources/javaee8:
get:
operationId: ping
responses:
default:
content:
'*/*':
schema:
type: object
description: Default Response.
/resources/randomNumberGen:
get:
operationId: randomNumberGen
responses:
default:
content:
'*/*':
schema:
type: integer
description: Default Response.
/rest/request:
get:
operationId: getXml
responses:
default:
content:
text/plain:
schema:
type: string
description: Default Response.
put:
operationId: putXml
requestBody:
content:
application/xml:
schema:
type: string
responses:
default:
content:
'*/*':
schema:
type: object
description: Default Response.
endpoints:
/ClusteredSingleton:
- /resources/javaee8
- /resources/randomNumberGen
/SimpleWAR:
- /rest/request
components: {}
----

[[openApi-configuration]]
== OpenAPI Configuration

Expand Down
Expand Up @@ -140,6 +140,113 @@ import org.eclipse.microprofile.openapi.annotations.Operation;
}
----

Here's an example of how the OpenAPI document of a sample application would look like::
[source, yml]
----
openapi: 3.0.0
info:
title: A Test Application
version: "1.0"
servers:
- url: http://localhost:8080/openapi-example-1.0
description: Default Server.
- url: https://localhost:8181/openapi-example-1.0
description: Default Server.
paths:
/api/hello:
get:
operationId: hello-world
responses:
default:
content:
text/plain:
schema:
type: string
description: Default Response.
deprecated: false
endpoints:
/openapi-example-1.0:
- /api/hello
components: {}
----

[[deployed-endpointts]]
==== Deployed Endpoints

When more than one application is deployed, a merge is done in the OpenAPI document. The resulting document will contain all application and path definitions present. To improve the its readability, an `endpoints` attribute which lists all deployed endpoints grouped by their application context roots has been added to the document.

NOTE: The `endpoints` attribute is an proprietary Payara Platform extension and it's not portable.

The following example shows an OpenAPI document generated when 2 different applications are deployed::
[source, yml]
----
openapi: 3.0.0
info:
title: Deployed Resources
version: 1.0.0
servers:
- url: http://localhost:8080/ClusteredSingleton
description: Default Server.
- url: https://localhost:8181/ClusteredSingleton
description: Default Server.
- url: http://localhost:8080/SimpleWAR
description: Default Server.
- url: https://localhost:8181/SimpleWAR
description: Default Server.
paths:
/resources/javaee8:
get:
operationId: ping
responses:
default:
content:
'*/*':
schema:
type: object
description: Default Response.
/resources/randomNumberGen:
get:
operationId: randomNumberGen
responses:
default:
content:
'*/*':
schema:
type: integer
description: Default Response.
/rest/request:
get:
operationId: getXml
responses:
default:
content:
text/plain:
schema:
type: string
description: Default Response.
put:
operationId: putXml
requestBody:
content:
application/xml:
schema:
type: string
responses:
default:
content:
'*/*':
schema:
type: object
description: Default Response.
endpoints:
/ClusteredSingleton:
- /resources/javaee8
- /resources/randomNumberGen
/SimpleWAR:
- /rest/request
components: {}
----

[[openApi-configuration]]
== OpenAPI Configuration

Expand Down