Gentics Portal | java has an ability to provide an OpenAPI v3.0 specification for every publicly available resource.

Setup

To enable the OpenAPI feature, simply set the dataProvider.serveOpenApi configuration in the server.yml file to true. The OpenAPI specification will be available at the /api/openapi.yaml endpoint.

Example

Can be checked at the link or below:

Default openapi.yaml
openapi: 3.0.1
info:
  title: Gentics Portal|Java
  version: 3.6.0
servers:
- url: http://localhost
security:
- apiKey: []
paths:
  /api/preview:
    summary: /api/preview/
    post:
      parameters: []
      responses:
        "200":
          description: Auto generated response description for /api/preview/
          content:
            '*/*': {}
  /GenticsImageStore/{width}/{height}/{mode}/{startx}/{starty}/{cropwidth}/{cropheight}/{path}:
    summary: GenticsImageStore Crop & Resize
    description: Prepares reroute for serving an image with given resizing and cropping
      specification
    get:
      summary: GenticsImageStore Crop & Resize
      description: Prepares reroute for serving an image with given resizing and cropping
        specification
      parameters:
      - name: mode
        in: path
        description: "Resize mode (force, smart, prop)"
        required: true
        schema:
          type: string
          description: "Resize mode (force, smart, prop)"
          example: smart
      - name: path
        in: path
        description: Actual path to the image
        required: true
        schema:
          type: string
          description: Actual path to the image
          example: /images/example.png
      - name: cropheight
        in: path
        description: Height for cropping
        required: true
        schema:
          type: string
          description: Height for cropping
          example: "150"
      - name: width
        in: path
        description: Width for cropping
        required: true
        schema:
          type: string
          description: Width for cropping
          example: "800"
      - name: starty
        in: path
        description: Y coordinate for cropping
        required: true
        schema:
          type: string
          description: Y coordinate for cropping
          example: "0"
      - name: startx
        in: path
        description: X coordinate for cropping
        required: true
        schema:
          type: string
          description: X coordinate for cropping
          example: "0"
      - name: cropwidth
        in: path
        description: Width for cropping
        required: true
        schema:
          type: string
          description: Width for cropping
          example: "200"
      - name: height
        in: path
        description: Height for cropping
        required: true
        schema:
          type: string
          description: Height for cropping
          example: "600"
      responses:
        "200":
          description: Modified image
      security: []
  /GenticsImageStore/{width}/{height}/{mode}/{path}:
    summary: GenticsImageStore Resize
    description: Prepares reroute for serving an image with given resizing specification
    get:
      summary: GenticsImageStore Resize
      description: Prepares reroute for serving an image with given resizing specification
      parameters:
      - name: mode
        in: path
        description: Resize mode
        required: true
        schema:
          type: string
          description: Resize mode
          example: smart
      - name: path
        in: path
        description: Actual path to the image
        required: true
        schema:
          type: string
          description: Actual path to the image
          example: /images/example.png
      - name: width
        in: path
        description: Width for cropping
        required: true
        schema:
          type: string
          description: Width for cropping
          example: "800"
      - name: height
        in: path
        description: Height for cropping
        required: true
        schema:
          type: string
          description: Height for cropping
          example: "600"
      responses:
        "200":
          description: Modified image
      security: []
  /api/openapi.yaml:
    summary: OpenAPI specification
    description: Returns the OpenAPI specification
    get:
      summary: OpenAPI specification
      description: Returns the OpenAPI specification
      parameters:
      - name: version
        in: query
        description: Specification version
        required: false
        schema:
          type: string
          description: Specification version
          default: v30
          enum:
          - v30
          - v31
      responses:
        default:
          description: application/x-yaml
          content:
            application/x-yaml: {}
        "200":
          description: YAML content
      security: []
  /api/openapi.json:
    summary: OpenAPI specification
    description: Returns the OpenAPI specification
    get:
      summary: OpenAPI specification
      description: Returns the OpenAPI specification
      parameters:
      - name: version
        in: query
        description: Specification version
        required: false
        schema:
          type: string
          description: Specification version
          default: v30
          enum:
          - v30
          - v31
      responses:
        default:
          description: application/json
          content:
            application/json: {}
        "200":
          description: JSON content
      security: []
  /api/version:
    summary: Version information
    description: Returns the Portal | java version
    get:
      summary: Version information
      description: Returns the Portal | java version
      parameters: []
      responses:
        default:
          description: application/json
          content:
            application/json: {}
        "200":
          description: The version of this portal
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AnyJson"
              example:
                productName: Gentics Portal | java
                productVersion: 3.6.0
      security: []
  /api/clearCache:
    summary: Clear cache
    description: Clears the cache
    post:
      summary: Clear cache
      description: Clears the cache
      parameters: []
      requestBody:
        content:
          application/json:
            example: |-
              {
                "key" : "CONFIGURED_PORTAL_API_KEY"
              }
      responses:
        default:
          description: text/plain
          content:
            text/plain: {}
        "200":
          description: Cache was successfully cleared
        "403":
          description: Request denied due to missing/invalid API key
      security: []
  /api/preview/{contentPath}:
    summary: Preview
    description: Render a preview of the posted page
    post:
      summary: Preview
      description: Render a preview of the posted page
      parameters:
      - name: contentPath
        in: path
        description: Path of the content to preview
        required: true
        schema:
          type: string
          description: Path of the content to preview
          example: /en/welcome
      requestBody:
        content:
          application/json:
            example: |-
              {
                "uuid" : "b0ae041c824111ed9a480242ac180003",
                "language" : "en",
                "parentNode" : {
                  "uuid" : "f3bfdaab610911edb8080242ac140003",
                  "schema" : {
                    "name" : "project_content"
                  }
                },
                "schema" : {
                  "name" : "project_content"
                },
                "fields" : {
                  "filename" : "welcome",
                  "cms_id" : 1,
                  "createdate" : "2025-12-03T21:26:00Z",
                  "publishtimestamp" : "2025-12-03T21:26:00Z",
                  "description" : "",
                  "editdate" : "2025-12-03T21:26:00Z",
                  "nice_url" : null,
                  "pagecontent" : "<div class=\"welcome-text\">This is a test page</div>",
                  "editoremail" : "nowhere@gentics.com",
                  "gtx_url" : "/en/welcome",
                  "editor" : "Node Admin",
                  "templateName" : "startpage",
                  "contenttype" : "text/html",
                  "creator" : "Node Admin",
                  "publishermail" : "nowhere@gentics.com",
                  "name" : "Welcome",
                  "alternate_urls" : [ ],
                  "creatoremail" : "nowhere@gentics.com",
                  "publisher" : "Node Admin"
                }
              }
      responses:
        default:
          description: text/html
          content:
            text/html: {}
        "200":
          description: Requested resource for the preview
      security: []
  /api/language:
    summary: Language switch
    description: Switch the language served by the portal
    get:
      summary: Language switch
      description: Switch the language served by the portal
      parameters:
      - name: redirect
        in: query
        description: Path to redirect to after language switch
        required: false
        schema:
          type: string
          description: Path to redirect to after language switch
          example: /en/welcome
      - name: lang
        in: query
        description: The language to switch to
        required: false
        schema:
          type: string
          description: The language to switch to
          example: en
      responses:
        "400":
          description: Query parameters "lang" and "redirect" are missing or cannot
            be encoded
        "200":
          description: Language was successfully switched (no redirect)
        "303":
          description: Language was successfully switched (redirect to specified path
            or referer)
      security: []
  /static/{path}:
    summary: Static files
    description: Serves static files from the portals "static" directory
    get:
      summary: Static files
      description: Serves static files from the portals "static" directory
      parameters:
      - name: path
        in: path
        description: Path to the static file
        required: true
        schema:
          type: string
          description: Path to the static file
          example: /css/style.css
      responses:
        "200":
          description: Requested static resource
      security: []
  /formgen/*:path:
    summary: FormGen files
    description: Serves static files for the FormGen app
    get:
      summary: FormGen files
      description: Serves static files for the FormGen app
      parameters:
      - name: path
        in: path
        description: Path to the FormGen app
        required: true
        schema:
          type: string
          description: Path to the FormGen app
          example: /index.js
      responses:
        "200":
          description: Requested FormGen app resource
      security: []
  /*:
    summary: Main content route
    description: Delivers the page or binary with the given path
    get:
      summary: Main content route
      description: Delivers the page or binary with the given path
      parameters: []
      responses:
        "200":
          description: "Requested content, either page, or binary data, or any other\
            \ resource"
      security: []
components:
  schemas:
    AnyJson: {}
  securitySchemes:
    apiKey:
      type: apiKey
      name: X-GPJ-API-Key
      in: header
      scheme: bearer