144 lines
3.2 KiB
YAML
144 lines
3.2 KiB
YAML
basePath: /api/v1
|
|
definitions:
|
|
models.ErrorResponse:
|
|
properties:
|
|
code:
|
|
type: integer
|
|
error:
|
|
type: string
|
|
message:
|
|
type: string
|
|
type: object
|
|
models.ExampleGetResponse:
|
|
properties:
|
|
message:
|
|
type: string
|
|
type: object
|
|
models.ExamplePostRequest:
|
|
properties:
|
|
age:
|
|
type: integer
|
|
name:
|
|
type: string
|
|
required:
|
|
- age
|
|
- name
|
|
type: object
|
|
models.ExamplePostResponse:
|
|
properties:
|
|
id:
|
|
type: string
|
|
message:
|
|
type: string
|
|
type: object
|
|
models.HealthResponse:
|
|
properties:
|
|
details:
|
|
additionalProperties:
|
|
type: string
|
|
type: object
|
|
status:
|
|
type: string
|
|
timestamp:
|
|
type: string
|
|
type: object
|
|
models.HelloWorldResponse:
|
|
properties:
|
|
message:
|
|
type: string
|
|
version:
|
|
type: string
|
|
type: object
|
|
host: localhost:8080
|
|
info:
|
|
contact:
|
|
email: support@swagger.io
|
|
name: API Support
|
|
url: http://www.swagger.io/support
|
|
description: A comprehensive Go API service with Swagger documentation
|
|
license:
|
|
name: Apache 2.0
|
|
url: http://www.apache.org/licenses/LICENSE-2.0.html
|
|
termsOfService: http://swagger.io/terms/
|
|
title: API Service
|
|
version: 1.0.0
|
|
paths:
|
|
/:
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: Returns a hello world message
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: Hello world message
|
|
schema:
|
|
$ref: '#/definitions/models.HelloWorldResponse'
|
|
summary: Hello World endpoint
|
|
tags:
|
|
- root
|
|
/api/v1/example:
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: Returns a simple message for GET request
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: Example GET response
|
|
schema:
|
|
$ref: '#/definitions/models.ExampleGetResponse'
|
|
summary: Example GET service
|
|
tags:
|
|
- example
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Accepts a JSON payload and returns a response with an ID
|
|
parameters:
|
|
- description: Example POST request
|
|
in: body
|
|
name: request
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/models.ExamplePostRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: Example POST response
|
|
schema:
|
|
$ref: '#/definitions/models.ExamplePostResponse'
|
|
"400":
|
|
description: Bad request
|
|
schema:
|
|
$ref: '#/definitions/models.ErrorResponse'
|
|
summary: Example POST service
|
|
tags:
|
|
- example
|
|
/health:
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: Returns the health status of the API service
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: Health status
|
|
schema:
|
|
$ref: '#/definitions/models.HealthResponse'
|
|
"500":
|
|
description: Internal server error
|
|
schema:
|
|
$ref: '#/definitions/models.ErrorResponse'
|
|
summary: Health check endpoint
|
|
tags:
|
|
- health
|
|
schemes:
|
|
- http
|
|
- https
|
|
swagger: "2.0"
|