openapi: 3.0.0 info: description: > Directs GET and POST HTTP requests to the PostgreSQL database by calling functions http.get and http.post respectively. version: "1.0.0" title: > Apostol: Postgres Fetch contact: email: apostoldevel@gmail.com license: name: MIT License url: https://github.com/apostoldevel/apostol/blob/master/LICENSE externalDocs: description: GitHub url: https://github.com/apostoldevel/apostol servers: - url: 'http://{host}:{port}/api/v1' description: Custom variables: host: default: localhost port: default: '8080' tags: - name: GET description: > Processing an HTTP GET request in a PostgreSQL database (the `http.get` function is called). - name: POST description: > Processing an HTTP POST request in a PostgreSQL database (the `http.post` function is called). paths: /ping: get: tags: - GET summary: Checking the connection. responses: '200': description: OK. content: application/json: schema: $ref: '#/components/schemas/error' '400': $ref: '#/components/responses/BadRequest' '404': $ref: '#/components/responses/NotFound' '5XX': $ref: '#/components/responses/InternalError' post: tags: - POST summary: Checking the connection. responses: '200': description: OK. content: application/json: schema: $ref: '#/components/schemas/error' '400': $ref: '#/components/responses/BadRequest' '404': $ref: '#/components/responses/NotFound' '5XX': $ref: '#/components/responses/InternalError' /time: get: tags: - GET summary: Server time. responses: '200': description: OK. content: application/json: schema: type: object properties: serverTime: type: integer description: UNIX time example: serverTime: 1642521843938 '400': $ref: '#/components/responses/BadRequest' '404': $ref: '#/components/responses/NotFound' '5XX': $ref: '#/components/responses/InternalError' post: tags: - POST summary: Server time. responses: '200': description: OK. content: application/json: schema: type: object properties: serverTime: type: integer description: UNIX time example: serverTime: 1642521843938 '400': $ref: '#/components/responses/BadRequest' '404': $ref: '#/components/responses/NotFound' '5XX': $ref: '#/components/responses/InternalError' /headers: get: tags: - GET summary: HTTP request headers. parameters: - $ref: '#/components/parameters/resultObject' - $ref: '#/components/parameters/resultFormat' responses: '200': description: OK. content: application/json: schema: $ref: '#/components/schemas/headers' '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Unauthorized' '404': $ref: '#/components/responses/NotFound' '5XX': $ref: '#/components/responses/InternalError' post: tags: - POST summary: HTTP request headers. parameters: - $ref: '#/components/parameters/resultObject' - $ref: '#/components/parameters/resultFormat' responses: '200': description: OK. content: application/json: schema: $ref: '#/components/schemas/headers' '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Unauthorized' '404': $ref: '#/components/responses/NotFound' '5XX': $ref: '#/components/responses/InternalError' /params: get: tags: - GET summary: Request Parameters. parameters: - $ref: '#/components/parameters/resultObject' - $ref: '#/components/parameters/resultFormat' responses: '200': description: OK. content: application/json: schema: $ref: '#/components/schemas/params' '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Unauthorized' '404': $ref: '#/components/responses/NotFound' '5XX': $ref: '#/components/responses/InternalError' post: tags: - POST summary: Request Parameters. parameters: - $ref: '#/components/parameters/resultObject' - $ref: '#/components/parameters/resultFormat' responses: '200': description: OK. content: application/json: schema: $ref: '#/components/schemas/params' '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Unauthorized' '404': $ref: '#/components/responses/NotFound' '5XX': $ref: '#/components/responses/InternalError' /body: post: tags: - POST summary: Echo response of the request body. parameters: - $ref: '#/components/parameters/resultObject' - $ref: '#/components/parameters/resultFormat' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/body' responses: '200': description: OK. content: application/json: schema: $ref: '#/components/schemas/body' '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Unauthorized' '404': $ref: '#/components/responses/NotFound' '5XX': $ref: '#/components/responses/InternalError' components: parameters: resultObject: in: query name: result_object required: false schema: type: string enum: [true, false] description: Wrap the result in a JSON-object named "result". resultFormat: in: query name: result_format required: false schema: type: string enum: [object, array, null] description: > All endpoints are returned: JSON-object or JSON-array depending on the number of entries in the response. You can change this behavior with this setting. responses: BadRequest: description: Bad request content: application/json: schema: $ref: '#/components/schemas/error' NotFound: description: The specified resource was not found content: application/json: schema: $ref: '#/components/schemas/error' Unauthorized: description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/error' InternalError: description: Internal error content: application/json: schema: $ref: '#/components/schemas/error' schemas: headers: type: object params: type: object body: type: object error: type: object required: - code - message properties: error: type: object properties: code: type: integer format: int32 message: type: string