Skip to content

Commit

Permalink
LPD-X Create rest-openapi.yaml with an example of inheritance (allOf)…
Browse files Browse the repository at this point in the history
… and polymorphism (oneOf) and a POST endpoint
  • Loading branch information
ruben-pulido committed Jun 18, 2024
1 parent 5b0207a commit 053dbd9
Showing 1 changed file with 86 additions and 0 deletions.
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"]

0 comments on commit 053dbd9

Please sign in to comment.