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

     1  // Code generated by go-swagger; DO NOT EDIT.
     2  
     3  package restapi
     4  
     5  // This file was generated by the swagger tool.
     6  // Editing this file might prove futile when you re-run the swagger generate command
     7  
     8  import (
     9  	"encoding/json"
    10  )
    11  
    12  var (
    13  	// SwaggerJSON embedded version of the swagger document used at generation time
    14  	SwaggerJSON json.RawMessage
    15  	// FlatSwaggerJSON embedded flattened version of the swagger document used at generation time
    16  	FlatSwaggerJSON json.RawMessage
    17  )
    18  
    19  func init() {
    20  	SwaggerJSON = json.RawMessage([]byte(`{
    21    "consumes": [
    22      "application/keyauth.api.v1+json"
    23    ],
    24    "produces": [
    25      "application/keyauth.api.v1+json"
    26    ],
    27    "schemes": [
    28      "http"
    29    ],
    30    "swagger": "2.0",
    31    "info": {
    32      "title": "keyauth debug",
    33      "version": "0.3.0"
    34    },
    35    "basePath": "/api",
    36    "paths": {
    37      "/customers": {
    38        "get": {
    39          "tags": [
    40            "customers"
    41          ],
    42          "summary": "Get a customerId given an SSN",
    43          "operationId": "getId",
    44          "parameters": [
    45            {
    46              "name": "info",
    47              "in": "body",
    48              "schema": {
    49                "$ref": "#/definitions/social_id"
    50              }
    51            }
    52          ],
    53          "responses": {
    54            "200": {
    55              "description": "OK",
    56              "schema": {
    57                "$ref": "#/definitions/customer"
    58              }
    59            },
    60            "401": {
    61              "description": "unauthorized",
    62              "schema": {
    63                "$ref": "#/definitions/error"
    64              }
    65            },
    66            "404": {
    67              "description": "resource not found",
    68              "schema": {
    69                "$ref": "#/definitions/error"
    70              }
    71            },
    72            "default": {
    73              "description": "error",
    74              "schema": {
    75                "$ref": "#/definitions/error"
    76              }
    77            }
    78          }
    79        },
    80        "post": {
    81          "tags": [
    82            "customers"
    83          ],
    84          "summary": "Create a new customer to track",
    85          "operationId": "create",
    86          "parameters": [
    87            {
    88              "name": "info",
    89              "in": "body",
    90              "schema": {
    91                "$ref": "#/definitions/customer"
    92              }
    93            }
    94          ],
    95          "responses": {
    96            "201": {
    97              "description": "created",
    98              "schema": {
    99                "$ref": "#/definitions/customer"
   100              }
   101            },
   102            "default": {
   103              "description": "error",
   104              "schema": {
   105                "$ref": "#/definitions/error"
   106              }
   107            }
   108          }
   109        }
   110      }
   111    },
   112    "definitions": {
   113      "customer": {
   114        "type": "object",
   115        "required": [
   116          "customerId",
   117          "name",
   118          "surname",
   119          "ssn",
   120          "fipsCode"
   121        ],
   122        "properties": {
   123          "agentId": {
   124            "description": "agent associated with this customer",
   125            "type": "integer",
   126            "format": "int32"
   127          },
   128          "customerId": {
   129            "description": "internal identifier of a customer",
   130            "type": "integer",
   131            "format": "int64",
   132            "readOnly": true
   133          },
   134          "fipsCode": {
   135            "type": "string",
   136            "format": "string",
   137            "minLength": 1
   138          },
   139          "name": {
   140            "type": "string",
   141            "format": "string",
   142            "minLength": 1
   143          },
   144          "ssn": {
   145            "description": "Lookup identifier to find a customer in the system",
   146            "type": "string",
   147            "format": "string",
   148            "minLength": 11
   149          },
   150          "surname": {
   151            "type": "string",
   152            "format": "string",
   153            "minLength": 1
   154          }
   155        }
   156      },
   157      "error": {
   158        "type": "object",
   159        "required": [
   160          "message"
   161        ],
   162        "properties": {
   163          "code": {
   164            "type": "integer",
   165            "format": "int64"
   166          },
   167          "fields": {
   168            "type": "string"
   169          },
   170          "message": {
   171            "type": "string"
   172          }
   173        }
   174      },
   175      "principal": {
   176        "type": "string"
   177      },
   178      "social_id": {
   179        "type": "object",
   180        "required": [
   181          "ssn"
   182        ],
   183        "properties": {
   184          "ssn": {
   185            "type": "string",
   186            "format": "string",
   187            "minLength": 11
   188          }
   189        }
   190      }
   191    },
   192    "securityDefinitions": {
   193      "key": {
   194        "type": "apiKey",
   195        "name": "x-token",
   196        "in": "header"
   197      }
   198    },
   199    "security": [
   200      {
   201        "key": []
   202      }
   203    ]
   204  }`))
   205  	FlatSwaggerJSON = json.RawMessage([]byte(`{
   206    "consumes": [
   207      "application/keyauth.api.v1+json"
   208    ],
   209    "produces": [
   210      "application/keyauth.api.v1+json"
   211    ],
   212    "schemes": [
   213      "http"
   214    ],
   215    "swagger": "2.0",
   216    "info": {
   217      "title": "keyauth debug",
   218      "version": "0.3.0"
   219    },
   220    "basePath": "/api",
   221    "paths": {
   222      "/customers": {
   223        "get": {
   224          "tags": [
   225            "customers"
   226          ],
   227          "summary": "Get a customerId given an SSN",
   228          "operationId": "getId",
   229          "parameters": [
   230            {
   231              "name": "info",
   232              "in": "body",
   233              "schema": {
   234                "$ref": "#/definitions/social_id"
   235              }
   236            }
   237          ],
   238          "responses": {
   239            "200": {
   240              "description": "OK",
   241              "schema": {
   242                "$ref": "#/definitions/customer"
   243              }
   244            },
   245            "401": {
   246              "description": "unauthorized",
   247              "schema": {
   248                "$ref": "#/definitions/error"
   249              }
   250            },
   251            "404": {
   252              "description": "resource not found",
   253              "schema": {
   254                "$ref": "#/definitions/error"
   255              }
   256            },
   257            "default": {
   258              "description": "error",
   259              "schema": {
   260                "$ref": "#/definitions/error"
   261              }
   262            }
   263          }
   264        },
   265        "post": {
   266          "tags": [
   267            "customers"
   268          ],
   269          "summary": "Create a new customer to track",
   270          "operationId": "create",
   271          "parameters": [
   272            {
   273              "name": "info",
   274              "in": "body",
   275              "schema": {
   276                "$ref": "#/definitions/customer"
   277              }
   278            }
   279          ],
   280          "responses": {
   281            "201": {
   282              "description": "created",
   283              "schema": {
   284                "$ref": "#/definitions/customer"
   285              }
   286            },
   287            "default": {
   288              "description": "error",
   289              "schema": {
   290                "$ref": "#/definitions/error"
   291              }
   292            }
   293          }
   294        }
   295      }
   296    },
   297    "definitions": {
   298      "customer": {
   299        "type": "object",
   300        "required": [
   301          "customerId",
   302          "name",
   303          "surname",
   304          "ssn",
   305          "fipsCode"
   306        ],
   307        "properties": {
   308          "agentId": {
   309            "description": "agent associated with this customer",
   310            "type": "integer",
   311            "format": "int32"
   312          },
   313          "customerId": {
   314            "description": "internal identifier of a customer",
   315            "type": "integer",
   316            "format": "int64",
   317            "readOnly": true
   318          },
   319          "fipsCode": {
   320            "type": "string",
   321            "format": "string",
   322            "minLength": 1
   323          },
   324          "name": {
   325            "type": "string",
   326            "format": "string",
   327            "minLength": 1
   328          },
   329          "ssn": {
   330            "description": "Lookup identifier to find a customer in the system",
   331            "type": "string",
   332            "format": "string",
   333            "minLength": 11
   334          },
   335          "surname": {
   336            "type": "string",
   337            "format": "string",
   338            "minLength": 1
   339          }
   340        }
   341      },
   342      "error": {
   343        "type": "object",
   344        "required": [
   345          "message"
   346        ],
   347        "properties": {
   348          "code": {
   349            "type": "integer",
   350            "format": "int64"
   351          },
   352          "fields": {
   353            "type": "string"
   354          },
   355          "message": {
   356            "type": "string"
   357          }
   358        }
   359      },
   360      "principal": {
   361        "type": "string"
   362      },
   363      "social_id": {
   364        "type": "object",
   365        "required": [
   366          "ssn"
   367        ],
   368        "properties": {
   369          "ssn": {
   370            "type": "string",
   371            "format": "string",
   372            "minLength": 11
   373          }
   374        }
   375      }
   376    },
   377    "securityDefinitions": {
   378      "key": {
   379        "type": "apiKey",
   380        "name": "x-token",
   381        "in": "header"
   382      }
   383    },
   384    "security": [
   385      {
   386        "key": []
   387      }
   388    ]
   389  }`))
   390  }