# Code generated by Frodo - DO NOT EDIT. # # Timestamp: {{ .TimestampString }} # Source: {{ .Path }} # Generator: https:#github.com/bridgekit-io/frodo # openapi: 3.0.0 info: title: {{ .Service.Name }} version: "{{ .Service.Version }}" servers: - url: {{ .Service.Gateway.PathPrefix | LeadingSlash }} paths: {{ range $method := .Service.Functions }} {{ $apiRoute := .Routes.API }} {{ if not $apiRoute }} {{ continue }} {{ end }} {{ $pathFields := $apiRoute.PathParameters }} {{ $queryFields := $apiRoute.QueryParameters }} "{{ $apiRoute.Path | OpenAPIPath }}": {{ $apiRoute.Method | ToLower }}: description: > {{ range .Documentation }} {{ . }}{{ end }} {{ if or $pathFields.NotEmpty $queryFields.NotEmpty }} parameters: {{ range $pathFields }} - in: path name: {{ .Name }} required: true {{ if .Field.Documentation.NotEmpty }} description: > {{ range .Field.Documentation }} {{ . }}{{ end }} {{ end }} schema: type: {{ .Field.Type | JSONType }} {{ end }} {{ range $queryFields }} - in: query name: {{ .Name }} {{ if .Field.Documentation.NotEmpty }} description: > {{ range .Field.Documentation }} {{ . }}{{ end }} {{ end }} schema: type: {{ .Field.Type | JSONType }} {{ end }} {{ end }} {{ if $apiRoute.SupportsRequestBody }} requestBody: content: application/json: schema: $ref: '#/components/schemas/{{ .Request.Name }}' {{ end }} responses: {{ $apiRoute.Status }}: description: Success content: application/json: schema: $ref: '#/components/schemas/{{ .Response.Name }}' {{ end }} components: schemas: {{ range .Types.NonBasicTypes }} {{ .Name | NoPointer }}: type: {{ . | JSONType }} {{ if .Fields.NotEmpty }} properties: {{ range $field := .NonOmittedFields }} {{ .Binding.Name | NoPointer }}: {{ if .Type.Basic }}type: {{ .Type | JSONType }}{{ end }} {{ if not .Type.Basic }}$ref: "#/components/schemas/{{ .Type.Name | NoPointer }}"{{ end }} {{ if and .Type.Basic .Type.SliceLike }} items: {{ if .Type.Elem.Basic }}type: {{ .Type.Elem | JSONType }}{{ end }} {{ if not .Type.Elem.Basic }}$ref: "#/components/schemas/{{ .Type.Elem.Name | NoPointer }}"{{ end }} {{ end }} {{ if .Documentation.NotEmpty }}description: > {{ range .Documentation }} {{ . }}{{ end }} {{ end }} {{ end }} {{ end }} {{ end }}