Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

IBM/oas-overlay-java

Open more actions menu

Repository files navigation

oas-overlay-java

Java library for processing OpenAPI Overlay documents

Usage

The OverlayProcessor class provides a method processOverlay which takes the OpenAPI document as a String and the Overlay document as a String and returns a String of the OpenAPI document with the updates applied.

Example:

public class OverlayExample {

    private static String openAPI = """
openapi: 3.1.0
info:
  title: Example API
  version: 1.0.0
paths:
  /example:
    get:
      responses:
        '200':
          description: A simple example response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
    """

    private static String overlay = """
overlay: 1.0.0
info:
  title: Overlay to update the description
  version: 1.0.0
actions:
- target: $.info
  update:
    description: >-
      A description about the API for the user to understand what is going on.
    """

    public static void main(String arg[]) {
        System.out.println(OverlayProcessor.processOverlay(openAPI, overlay));
    }
}

About

Java library for processing OpenAPI Overlay documents

Resources

Security policy

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.