forked from liferay/liferay-portal
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LPD-X Create rest-openapi.yaml with an example of inheritance (allOf)…
… and polymorphism (oneOf) and a POST endpoint
- Loading branch information
1 parent
5b0207a
commit 053dbd9
Showing
1 changed file
with
86 additions
and
0 deletions.
There are no files selected for viewing
86 changes: 86 additions & 0 deletions
86
modules/apps/headless/headless-admin-site/headless-admin-site-impl/rest-openapi.yaml
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 |
---|---|---|
@@ -0,0 +1,86 @@ | ||
components: | ||
schemas: | ||
BasePageTemplate: | ||
# @review | ||
description: | ||
Represents a base page template, containing the common properties of both a content page template and a | ||
widget page template. | ||
properties: | ||
name: | ||
# @review | ||
description: | ||
The page template's name. | ||
type: string | ||
type: | ||
enum: | ||
- ContentPageTemplate | ||
- WidgetPageTemplate | ||
type: string | ||
type: object | ||
ContentPageTemplate: | ||
allOf: | ||
- $ref: "#/components/schemas/BasePageTemplate" | ||
# @review | ||
description: | ||
Represents a content page template. | ||
type: object | ||
PageTemplate: | ||
oneOf: | ||
- $ref: "#/components/schemas/ContentPageTemplate" | ||
- $ref: "#/components/schemas/WidgetPageTemplate" | ||
type: object | ||
WidgetPageTemplate: | ||
allOf: | ||
- $ref: "#/components/schemas/BasePageTemplate" | ||
- properties: | ||
active: | ||
# @review | ||
description: | ||
A flag that indicates whether the widget page template is active. | ||
type: boolean | ||
# @review | ||
description: | ||
Represents a widget page template. | ||
type: object | ||
info: | ||
description: | ||
"A Java client JAR is available for use with the group ID 'com.liferay', artifact ID | ||
'com.liferay.headless.admin.site.client', and version '1.0.0'." | ||
license: | ||
name: Apache 2.0 | ||
url: http://www.apache.org/licenses/LICENSE-2.0.html | ||
title: Liferay Admin Sites Headless API | ||
version: v1.0 | ||
openapi: 3.0.1 | ||
paths: | ||
"/sites/{siteExternalReferenceCode}/page-templates": | ||
post: | ||
description: | ||
Adds a new page template | ||
parameters: | ||
- in: path | ||
name: siteExternalReferenceCode | ||
required: true | ||
schema: | ||
type: string | ||
requestBody: | ||
content: | ||
application/json: | ||
schema: | ||
$ref: "#/components/schemas/PageTemplate" | ||
application/xml: | ||
schema: | ||
$ref: "#/components/schemas/PageTemplate" | ||
responses: | ||
200: | ||
content: | ||
application/json: | ||
schema: | ||
$ref: "#/components/schemas/PageTemplate" | ||
application/xml: | ||
schema: | ||
$ref: "#/components/schemas/PageTemplate" | ||
description: | ||
default response | ||
# @review | ||
tags: ["PageTemplate"] |