github.com/thetreep/go-swagger@v0.0.0-20240223100711-35af64f14f01/examples/authentication/swagger.yml (about)

     1  ---
     2  
     3  swagger: '2.0'
     4  info:
     5    title: keyauth debug
     6    version: 0.3.0
     7  schemes:
     8    - http
     9  basePath: /api
    10  consumes:
    11    - application/keyauth.api.v1+json
    12  produces:
    13    - application/keyauth.api.v1+json
    14  securityDefinitions:
    15    key:
    16      type: apiKey
    17      in: header
    18      name: x-token
    19  security:
    20    - key: []
    21  paths:
    22    /customers:
    23      post:
    24        tags: ["customers"]
    25        operationId: create
    26        summary: Create a new customer to track
    27        parameters:
    28          - name: info
    29            in: body
    30            schema:
    31              $ref: "#/definitions/customer"
    32        responses:
    33          '201':
    34            description: created
    35            schema:
    36              $ref: "#/definitions/customer"
    37          default:
    38            description: error
    39            schema:
    40              $ref: "#/definitions/error"
    41      get:
    42        tags: ["customers"]
    43        operationId: getId
    44        summary: Get a customerId given an SSN
    45        parameters:
    46          - name: info
    47            in: body
    48            schema:
    49              $ref: "#/definitions/social_id"
    50        responses:
    51          '200':
    52            description: OK
    53            schema:
    54              $ref: "#/definitions/customer"
    55          '401':
    56            description: unauthorized
    57            schema:
    58              $ref: "#/definitions/error"
    59          '404':
    60            description: resource not found
    61            schema:
    62              $ref: "#/definitions/error"
    63          default:
    64            description: error
    65            schema:
    66              $ref: "#/definitions/error"
    67  definitions:
    68    customer:
    69      type: object
    70      required:
    71        - customerId
    72        - name
    73        - surname
    74        - ssn
    75        - fipsCode
    76      properties:
    77        customerId:
    78          type: integer
    79          format: int64
    80          readOnly: true
    81          description: internal identifier of a customer
    82        name:
    83          type: string
    84          format: string
    85          minLength: 1
    86        surname:
    87          type: string
    88          format: string
    89          minLength: 1
    90        agentId:
    91          type: integer
    92          format: int32
    93          description: agent associated with this customer
    94        ssn:
    95          type: string
    96          format: string
    97          minLength: 11
    98          description: Lookup identifier to find a customer in the system
    99        fipsCode:
   100          type: string
   101          format: string
   102          minLength: 1
   103    social_id:
   104      type: object
   105      required:
   106        - ssn
   107      properties:
   108        ssn:
   109          type: string
   110          format: string
   111          minLength: 11
   112    error:
   113      type: object
   114      required:
   115         - message
   116      properties:
   117        code:
   118          type: integer
   119          format: int64
   120        message:
   121          type: string
   122        fields:
   123          type: string
   124    principal:
   125      type: string
   126