# Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved.
# 
# 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 OpenAPI test 
  description: OpenAPI document for testing

  version: 1.0.0

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

paths:
  /greet/greeting:
    put:
      summary: Sets 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
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - greeting
              properties:
                greeting:
                  type: string

      responses:
        '204':
          description: Greeting set

  /greet/:
    get:
      summary: Returns a generic greeting
      description: Greets the user generically
      responses:
        '200':
          description: Simple JSON containing the greeting
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Hello World!
  /greet/{userID}:
    get:
      summary: Returns a personalized greeting
      parameters:
        - name: userID
          in: path
          required: true
          description: Name of the user to be used in the returned greeting
          schema:
            type: string
      responses:
        '200':
          description: Simple JSON containing the greeting
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Hello Joe!
