github.com/thetreep/go-swagger@v0.0.0-20240223100711-35af64f14f01/fixtures/bugs/2919/edge-api/shared/standard-responses.yml (about)

     1  ---
     2  responses:
     3    emptyResponse:
     4      description: Base empty response
     5      schema:
     6        $ref: '#/definitions/empty'
     7    deleteResponse:
     8      description: The delete request was successful and the resource has been removed
     9      schema:
    10        $ref: '#/definitions/empty'
    11    updateResponse:
    12      description: The update request was successful and the resource has been altered
    13      schema:
    14        $ref: '#/definitions/empty'
    15    patchResponse:
    16      description: The patch request was successful and the resource has been altered
    17      schema:
    18        $ref: '#/definitions/empty'
    19    createResponse:
    20      description: The create request was successful and the resource has been added at the following location
    21      schema:
    22        $ref: '#/definitions/createEnvelope'
    23    badRequestResponse:
    24      description: The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information
    25      schema:
    26        $ref: '#/definitions/apiErrorEnvelope'
    27      examples:
    28        'application/json':
    29          error:
    30            args:
    31              urlVars: { }
    32            cause:
    33              field: '(root)'
    34              type: required
    35              value:
    36                fooField: abc
    37                fooField2: def
    38              message: '(root): fooField3 is required'
    39              details:
    40                context: '(root)'
    41                field: '(root)'
    42                property: fooField3
    43            causeMessage: schema validation failed
    44            code: COULD_NOT_VALIDATE
    45            message: The supplied request contains an invalid document
    46            requestId: ac6766d6-3a09-44b3-8d8a-1b541d97fdd9
    47          meta:
    48            apiEnrollmentVersion: 0.0.1
    49            apiVersion: 0.0.1
    50    conflictResponse:
    51      description: The request could not be completed due to a conflict of configuration or state
    52      schema:
    53        $ref: '#/definitions/apiErrorEnvelope'
    54    unauthorizedResponse:
    55      description: The currently supplied session does not have the correct access rights to request this resource
    56      schema:
    57        $ref: '#/definitions/apiErrorEnvelope'
    58      examples:
    59        'application/json':
    60          error:
    61            args:
    62              urlVars: { }
    63            cause: ''
    64            causeMessage: ''
    65            code: UNAUTHORIZED
    66            message: The request could not be completed. The session is not authorized or the
    67              credentials are invalid
    68            requestId: 0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f
    69          meta:
    70            apiEnrollmentVersion: 0.0.1
    71            apiVersion: 0.0.1
    72    invalidAuthResponse:
    73      description: The authentication request could not be processed as the credentials are invalid
    74      schema:
    75        $ref: '#/definitions/apiErrorEnvelope'
    76      examples:
    77        'application/json':
    78          error:
    79            args:
    80              urlVars: { }
    81            cause: ''
    82            causeMessage: ''
    83            code: INVALID_AUTH
    84            message: The authentication request failed
    85            requestId: 5952ed10-3091-474f-a691-47ebab6990dc
    86          meta:
    87            apiEnrollmentVersion: 0.0.1
    88            apiVersion: 0.0.1
    89    notFoundResponse:
    90      description: The requested resource does not exist
    91      schema:
    92        $ref: '#/definitions/apiErrorEnvelope'
    93      examples:
    94        'application/json':
    95          error:
    96            args:
    97              urlVars:
    98                id: 71a3000f-7dda-491a-9b90-a19f4ee6c406
    99            cause:
   100            causeMessage: ''
   101            code: NOT_FOUND
   102            message: The resource requested was not found or is no longer available
   103            requestId: 270908d6-f2ef-4577-b973-67bec18ae376
   104          meta:
   105            apiEnrollmentVersion: 0.0.1
   106            apiVersion: 0.0.1
   107    cannotDeleteReferencedResourceResponse:
   108      description: The resource requested to be removed/altered cannot be as it is referenced by another object.
   109      schema:
   110        $ref: '#/definitions/apiErrorEnvelope'
   111      examples:
   112        'application/json':
   113          error:
   114            args:
   115              urlVars:
   116                id: 71a3000f-7dda-491a-9b90-a19f4ee6c406
   117            causeMessage: 'referenced by /some-resource/05f4f710-c155-4a74-86d5-77558eb9cb42'
   118            code: CONFLICT_CANNOT_MODIFY_REFERENCED
   119            message: The resource cannot be deleted/modified. Remove all referencing resources first.
   120            requestId: 270908d6-f2ef-4577-b973-67bec18ae376
   121          meta:
   122            apiEnrollmentVersion: 0.0.1
   123            apiVersion: 0.0.1
   124    rateLimitedResponse:
   125      description: The resource requested is rate limited and the rate limit has been exceeded
   126      schema:
   127        $ref: '#/definitions/apiErrorEnvelope'
   128      examples:
   129        'application/json':
   130          error:
   131            args:
   132              urlVars: { }
   133            causeMessage: 'you have hit a rate limit in the requested operation'
   134            code: RATE_LIMITED
   135            message: The resource is rate limited and the rate limit has been exceeded. Please try again later
   136            requestId: 270908d6-f2ef-4577-b973-67bec18ae376
   137          meta:
   138            apiEnrollmentVersion: 0.0.1
   139            apiVersion: 0.0.1
   140  definitions:
   141    empty:
   142      type: object
   143      required:
   144        - meta
   145        - data
   146      properties:
   147        meta:
   148          $ref: '#/definitions/meta'
   149        data:
   150          type: object
   151          example: { }
   152    meta:
   153      type: object
   154      properties:
   155        filterableFields:
   156          type: array
   157          items:
   158            type: string
   159          x-omitempty: true
   160        pagination:
   161          $ref: 'standard-request.yml#/definitions/pagination'
   162        apiEnrollmentVersion:
   163          type: string
   164        apiVersion:
   165          type: string
   166    createEnvelope:
   167      type: object
   168      properties:
   169        meta:
   170          $ref: '#/definitions/meta'
   171        data:
   172          $ref: '#/definitions/createLocation'
   173    createLocation:
   174      type: object
   175      properties:
   176        _links:
   177          $ref: 'base-entity.yml#/definitions/links'
   178        id:
   179          type: string
   180    apiErrorEnvelope:
   181      type: object
   182      required:
   183        - meta
   184        - error
   185      properties:
   186        meta:
   187          $ref: '#/definitions/meta'
   188        error:
   189          $ref: '#/definitions/apiError'
   190    apiError:
   191      type: object
   192      properties:
   193        args:
   194          $ref: '#/definitions/apiErrorArgs'
   195        data:
   196          type: object
   197          additionalProperties: true
   198        causeMessage:
   199          type: string
   200        code:
   201          type: string
   202        message:
   203          type: string
   204        requestId:
   205          type: string
   206        cause:
   207          $ref: '#/definitions/apiErrorCause'
   208    apiFieldError:
   209      type: object
   210      properties:
   211        reason:
   212          type: string
   213        field:
   214          type: string
   215        value:
   216          description: can be any value - string, number, boolean, array or object
   217    apiErrorCause:
   218      allOf:
   219        - $ref: '#/definitions/apiFieldError'
   220        - $ref: '#/definitions/apiError'
   221    apiErrorArgs:
   222      type: object
   223      properties:
   224        urlVars:
   225          properties: { }
   226          additionalProperties:
   227            type: string
   228          type: object