#
# Copyright (c) 2019,2020 Oracle and/or its affiliates.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
---
openapi: 3.0.0
info:
  title: Helidon SE Quickstart Example
  description: A very simple application to reply with friendly greetings
  version: 1.0.0

servers:
  - url: http://localhost:8080
    description: Local test server

paths:
  /greet:
    get:
      summary: Returns a generic greeting
      description: Greets the user generically
      responses:
        default:
          description: Simple JSON containing the greeting
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GreetingMessage'
  /greet/greeting:
    put:
      summary: Set the greeting prefix
      description: Permits the client to set the prefix part of the greeting ("Hello")
      requestBody:
        description: Conveys the new greeting prefix to use in building greetings
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GreetingMessage'
            examples:
              greeting:
                summary: Example greeting message to update
                value: New greeting message
      responses:
        "200":
          description: OK
          content:
            application/json: {}
  /greet/{name}:
    get:
      summary: Returns a personalized greeting
      parameters:
      - name: name
        in: path
        required: true
        schema:
          type: string
      responses:
        default:
          description: Simple JSON containing the greeting
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GreetingMessage'
components:
  schemas:
    GreetingMessage:
      properties:
        message:
          type: string
