github.com/kaisawind/go-swagger@v0.19.0/fixtures/codegen/todolist.schemavalidation.yml (about)

     1  swagger: '2.0'
     2  
     3  info:
     4    version: "1.0.0"
     5    title: Private to-do list
     6    description: |
     7      A very simple api description that makes a json only API to submit to do's.
     8  
     9  produces:
    10    - application/json
    11  
    12  consumes:
    13    - application/json
    14  
    15  paths:
    16    /models:
    17      get:
    18        operationId: modelOp
    19        summary: many model variations
    20        description: Used to see if a codegen can render all the possible parameter variations for a header param
    21        tags:
    22          - testcgen
    23        responses:
    24          default:
    25            description: Generic Out
    26  definitions:
    27    RequiredProps:
    28      type: object
    29      required:
    30        - id
    31        - name
    32        - createdAt
    33        - age
    34        - score
    35        - tags
    36      properties:
    37        id:
    38          type: integer
    39          format: int64
    40        name:
    41          type: string
    42        createdAt:
    43          type: string
    44          format: date-time
    45        age:
    46          type: integer
    47          format: int32
    48        score:
    49          type: number
    50          format: float
    51        tags:
    52          type: array
    53          items:
    54            type: string
    55  
    56    NamedString:
    57      type: string
    58      minLength: 2
    59      maxLength: 50
    60      pattern: "[A-Za-z0-9][\\w- ]+"
    61  
    62    StringValidations:
    63      type: "object"
    64      properties:
    65        name:
    66          type: string
    67          minLength: 2
    68          maxLength: 50
    69          pattern: "[A-Za-z0-9][\\w- ]+"
    70  
    71    NamedNumber:
    72      type: integer
    73      format: int32
    74      minimum: 0
    75      exclusiveMinimum: true
    76      maximum: 500
    77      multipleOf: 1.5
    78  
    79    NumberValidations:
    80      type: object
    81      properties:
    82        age:
    83          type: integer
    84          format: int32
    85          minimum: 0
    86          exclusiveMinimum: true
    87          maximum: 500
    88          multipleOf: 1.5
    89  
    90    NamedArray:
    91      type: array
    92      minItems: 3
    93      maxItems: 10
    94      items:
    95        minLength: 3
    96        maxLength: 10
    97        pattern: "\\w+"
    98        type: string
    99  
   100    ArrayValidations:
   101      type: object
   102      properties:
   103        tags:
   104          type: array
   105          minItems: 3
   106          maxItems: 10
   107          items:
   108            type: string
   109            minLength: 3
   110            maxLength: 10
   111            pattern: "\\w+"
   112  
   113    NamedNestedArray:
   114      type: array
   115      minItems: 3
   116      maxItems: 10
   117      items:
   118        type: array
   119        minItems: 3
   120        maxItems: 10
   121        items:
   122          minItems: 3
   123          maxItems: 10
   124          type: array
   125          items:
   126            type: string
   127            minLength: 3
   128            maxLength: 10
   129            pattern: "\\w+"
   130  
   131    NestedArrayValidations:
   132      type: object
   133      properties:
   134        tags:
   135          type: array
   136          minItems: 3
   137          maxItems: 10
   138          items:
   139            type: array
   140            minItems: 3
   141            maxItems: 10
   142            items:
   143              minItems: 3
   144              maxItems: 10
   145              type: array
   146              items:
   147                type: string
   148                minLength: 3
   149                maxLength: 10
   150                pattern: "\\w+"
   151  
   152    NamedNestedObject:
   153      type: object
   154      properties:
   155        meta:
   156          type: object
   157          properties:
   158            first:
   159              type: string
   160              minLength: 2
   161              maxLength: 50
   162              pattern: "^\\w+"
   163            second:
   164              type: number
   165              format: double
   166              minimum: 3
   167              maximum: 51
   168              multipleOf: 1.5
   169            third:
   170              type: array
   171              minItems: 5
   172              maxItems: 93
   173              items:
   174                type: number
   175                format: float
   176                minimum: 3
   177                maximum: 6
   178                multipleOf: 0.5
   179            fourth:
   180              minItems: 5
   181              maxItems: 93
   182              type: array
   183              items:
   184                type: array
   185                minItems: 5
   186                maxItems: 93
   187                items:
   188                  minItems: 5
   189                  maxItems: 93
   190                  type: array
   191                  items:
   192                    type: number
   193                    format: float
   194                    minimum: 3
   195                    maximum: 6
   196                    multipleOf: 0.5
   197  
   198    NestedObjectValidations:
   199      type: object
   200      properties:
   201        args:
   202          type: object
   203          properties:
   204            meta:
   205              type: object
   206              properties:
   207                first:
   208                  type: string
   209                  minLength: 2
   210                  maxLength: 50
   211                  pattern: "^\\w+"
   212                second:
   213                  type: number
   214                  format: double
   215                  minimum: 3
   216                  maximum: 51
   217                  multipleOf: 1.5
   218                third:
   219                  type: array
   220                  minItems: 5
   221                  maxItems: 93
   222                  items:
   223                    type: number
   224                    format: float
   225                    minimum: 3
   226                    maximum: 6
   227                    multipleOf: 0.5
   228                fourth:
   229                  minItems: 5
   230                  maxItems: 93
   231                  type: array
   232                  items:
   233                    type: array
   234                    minItems: 5
   235                    maxItems: 93
   236                    items:
   237                      minItems: 5
   238                      maxItems: 93
   239                      type: array
   240                      items:
   241                        type: number
   242                        format: float
   243                        minimum: 3
   244                        maximum: 6
   245                        multipleOf: 0.5
   246  
   247    NamedArrayMulti:
   248      type: array
   249      items:
   250        - minLength: 3
   251          maxLength: 10
   252          pattern: "\\w+"
   253          type: string
   254        - minimum: 3
   255          maximum: 12
   256          multipleOf: 1.5
   257          type: number
   258          format: double
   259  
   260    ArrayMultiValidations:
   261      type: object
   262      properties:
   263        args:
   264          type: array
   265          items:
   266            - minLength: 3
   267              maxLength: 10
   268              pattern: "\\w+"
   269              type: string
   270            - minimum: 3
   271              maximum: 12
   272              multipleOf: 1.5
   273              type: number
   274              format: double
   275  
   276    NamedArrayAdditional:
   277      type: array
   278      minItems: 3
   279      maxItems: 10
   280      items:
   281        - minLength: 3
   282          maxLength: 10
   283          pattern: "\\w+"
   284          type: string
   285        - minimum: 3
   286          maximum: 12
   287          multipleOf: 1.5
   288          type: number
   289          format: double
   290      additionalItems:
   291        type: integer
   292        format: int64
   293        minimum: 3
   294        maximum: 6
   295        multipleOf: 1
   296  
   297    ArrayAdditionalValidations:
   298      type: object
   299      properties:
   300        args:
   301          type: array
   302          items:
   303            - minLength: 3
   304              maxLength: 10
   305              pattern: "\\w+"
   306              type: string
   307            - minimum: 3
   308              maximum: 12
   309              multipleOf: 1.5
   310              type: number
   311              format: double
   312          additionalItems:
   313            type: integer
   314            format: int64
   315            minimum: 3
   316            maximum: 6
   317            multipleOf: 1
   318  
   319    NamedMap:
   320      type: object
   321      minProperties: 5
   322      maxProperties: 10
   323      additionalProperties:
   324        type: integer
   325        format: int64
   326        minimum: 3
   327        maximum: 6
   328        multipleOf: 1
   329  
   330    NamedMapComplex:
   331      type: object
   332      minProperties: 5
   333      maxProperties: 10
   334      additionalProperties:
   335        type: object
   336        properties:
   337          name:
   338            type: string
   339            minLength: 10
   340            maxLength: 50
   341            pattern: "\\w+"
   342          age:
   343            type: integer
   344            format: int32
   345            multipleOf: 1
   346            minimum: 1
   347            maximum: 200
   348            exclusiveMaximum: true
   349            exclusiveMinimum: true
   350  
   351    MapValidations:
   352      type: object
   353      properties:
   354        meta:
   355          type: object
   356          additionalProperties:
   357            type: integer
   358            format: int64
   359            minimum: 3
   360            maximum: 6
   361            multipleOf: 1
   362  
   363    MapComplexValidations:
   364      type: object
   365      properties:
   366        meta:
   367          type: object
   368          additionalProperties:
   369            type: object
   370            properties:
   371              name:
   372                type: string
   373                minLength: 10
   374                maxLength: 50
   375                pattern: "\\w+"
   376              age:
   377                type: integer
   378                format: int32
   379                multipleOf: 1
   380                minimum: 1
   381                maximum: 200
   382                exclusiveMaximum: true
   383                exclusiveMinimum: true
   384  
   385    NamedNestedMap:
   386      type: object
   387      additionalProperties:
   388        type: object
   389        additionalProperties:
   390          type: object
   391          additionalProperties:
   392            type: integer
   393            format: int64
   394            minimum: 3
   395            maximum: 6
   396            multipleOf: 1
   397  
   398    NamedNestedMapComplex:
   399      type: object
   400      additionalProperties:
   401        type: object
   402        additionalProperties:
   403          type: object
   404          additionalProperties:
   405            type: object
   406            properties:
   407              name:
   408                type: string
   409                minLength: 10
   410                maxLength: 50
   411                pattern: "\\w+"
   412              age:
   413                type: integer
   414                format: int32
   415                multipleOf: 1
   416                minimum: 1
   417                maximum: 200
   418                exclusiveMaximum: true
   419                exclusiveMinimum: true
   420  
   421    NestedMapValidations:
   422      type: object
   423      properties:
   424        meta:
   425          type: object
   426          additionalProperties:
   427            type: object
   428            additionalProperties:
   429              type: object
   430              additionalProperties:
   431                type: integer
   432                format: int64
   433                minimum: 3
   434                maximum: 6
   435                multipleOf: 1
   436  
   437    NestedMapComplexValidations:
   438      type: object
   439      properties:
   440        meta:
   441          type: object
   442          additionalProperties:
   443            type: object
   444            additionalProperties:
   445              type: object
   446              additionalProperties:
   447                type: object
   448                properties:
   449                  name:
   450                    type: string
   451                    minLength: 10
   452                    maxLength: 50
   453                    pattern: "\\w+"
   454                  age:
   455                    type: integer
   456                    format: int32
   457                    multipleOf: 1
   458                    minimum: 1
   459                    maximum: 200
   460                    exclusiveMaximum: true
   461                    exclusiveMinimum: true
   462  
   463    NamedAllOf:
   464      type: object
   465      allOf:
   466      - type: object
   467        properties:
   468          name:
   469            type: string
   470            minLength: 2
   471            maxLength: 50
   472            pattern: "[A-Za-z0-9][\\w- ]+"
   473      - type: object
   474        properties:
   475          age:
   476            type: integer
   477            format: int32
   478            minimum: 2
   479            maximum: 50
   480            multipleOf: 1.5
   481      - type: object
   482        properties:
   483          args:
   484            type: array
   485            minItems: 5
   486            maxItems: 20
   487            items:
   488              type: string
   489              minLength: 2
   490              maxLength: 50
   491              pattern: "[A-Za-z0-9][\\w- ]+"
   492      - type: object
   493        properties:
   494          assoc:
   495            type: array
   496            minItems: 5
   497            maxItems: 20
   498            items:
   499              type: array
   500              minItems: 5
   501              maxItems: 20
   502              items:
   503                type: array
   504                minItems: 5
   505                maxItems: 20
   506                items:
   507                  type: string
   508                  minLength: 2
   509                  maxLength: 50
   510                  pattern: "[A-Za-z0-9][\\w- ]+"
   511      - type: object
   512        properties:
   513          opts:
   514            type: object
   515            additionalProperties:
   516              type: number
   517              format: float32
   518              minimum: 2
   519              maximum: 50
   520              multipleOf: 1.5
   521  
   522      - type: object
   523        properties:
   524          extOpts:
   525            type: object
   526            additionalProperties:
   527              type: object
   528              additionalProperties:
   529                type: object
   530                additionalProperties:
   531                  type: integer
   532                  format: int32
   533                  minimum: 2
   534                  maximum: 50
   535                  multipleOf: 1.5
   536      - type: object
   537        properties:
   538          coords:
   539            type: object
   540            allOf:
   541            - type: object
   542              properties:
   543                name:
   544                  type: string
   545                  minLength: 2
   546                  maxLength: 50
   547                  pattern: "[A-Za-z0-9][\\w- ]+"
   548            - type: object
   549              properties:
   550                age:
   551                  type: integer
   552                  format: int32
   553                  minimum: 2
   554                  maximum: 50
   555                  multipleOf: 1.5
   556  
   557    AllOfValidations:
   558      type: object
   559      properties:
   560        meta:
   561          type: object
   562          allOf:
   563          - type: object
   564            properties:
   565              name:
   566                type: string
   567                minLength: 2
   568                maxLength: 50
   569                pattern: "[A-Za-z0-9][\\w- ]+"
   570          - type: object
   571            properties:
   572              age:
   573                type: integer
   574                format: int32
   575                minimum: 2
   576                maximum: 50
   577                multipleOf: 1.5
   578          - type: object
   579            properties:
   580              args:
   581                type: array
   582                minItems: 5
   583                maxItems: 20
   584                items:
   585                  type: string
   586                  minLength: 2
   587                  maxLength: 50
   588                  pattern: "[A-Za-z0-9][\\w- ]+"
   589          - type: object
   590            properties:
   591              assoc:
   592                type: array
   593                minItems: 5
   594                maxItems: 20
   595                items:
   596                  type: array
   597                  minItems: 5
   598                  maxItems: 20
   599                  items:
   600                    type: array
   601                    minItems: 5
   602                    maxItems: 20
   603                    items:
   604                      type: string
   605                      minLength: 2
   606                      maxLength: 50
   607                      pattern: "[A-Za-z0-9][\\w- ]+"
   608          - type: object
   609            properties:
   610              opts:
   611                type: object
   612                additionalProperties:
   613                  type: integer
   614                  format: int32
   615                  minimum: 2
   616                  maximum: 50
   617                  multipleOf: 1.5
   618          - type: object
   619            properties:
   620              extOpts:
   621                type: object
   622                additionalProperties:
   623                  type: object
   624                  additionalProperties:
   625                    type: object
   626                    additionalProperties:
   627                      type: integer
   628                      format: int32
   629                      minimum: 2
   630                      maximum: 50
   631                      multipleOf: 1.5
   632          - type: object
   633            properties:
   634              coords:
   635                type: object
   636                allOf:
   637                - type: object
   638                  properties:
   639                    name:
   640                      type: string
   641                      minLength: 2
   642                      maxLength: 50
   643                      pattern: "[A-Za-z0-9][\\w- ]+"
   644                - type: object
   645                  properties:
   646                    age:
   647                      type: integer
   648                      format: int32
   649                      minimum: 2
   650                      maximum: 50
   651                      multipleOf: 1.5
   652  
   653    RefedAllOfValidations:
   654      type: object
   655      allOf:
   656        - $ref: "#/definitions/NamedString"
   657        - $ref: "#/definitions/NamedNumber"
   658  
   659    SimpleZeroAllowed:
   660      type: object
   661      required: ["name", "urls"]
   662      properties:
   663        id:
   664          type: string
   665          minLength: 2
   666          maxLength: 50
   667          pattern: "[A-Za-z0-9][\\w- ]+"
   668        name:
   669          type: string
   670          minLength: 2
   671          maxLength: 50
   672          pattern: "[A-Za-z0-9][\\w- ]+"
   673        urls:
   674          type: array
   675          items:
   676            type: string
   677  
   678    Pet:
   679      type: object
   680      required:
   681        - name
   682        - photoUrls
   683      properties:
   684        id:
   685          type: integer
   686          format: int64
   687        category:
   688          $ref: "#/definitions/Category"
   689        name:
   690          type: string
   691          example: doggie
   692        photoUrls:
   693          type: array
   694          xml:
   695            name: "photoUrl"
   696            wrapped: true
   697          items:
   698            type: string
   699        tags:
   700          type: array
   701          xml:
   702            name: tag
   703            wrapped: true
   704          items:
   705            $ref: "#/definitions/Tag"
   706        status:
   707          type: string
   708          description: "pet status in the store"
   709          enum:
   710            - available
   711            - pending
   712            - sold
   713      xml:
   714        name: Pet
   715  
   716    Tag:
   717      type: object
   718      xml:
   719        name: Tag
   720      properties:
   721        id:
   722          type: integer
   723          format: int64
   724        name:
   725          type: string
   726  
   727    Category:
   728      type: object
   729      xml:
   730        name: Category
   731      properties:
   732        id:
   733          type: integer
   734          format: int64
   735        name:
   736          type: string
   737  
   738    UpdateOrg:
   739      type: object
   740      description: "Description of updates for an existing organization"
   741      properties:
   742        invoice_email:
   743          type: boolean
   744          description: "Wheter the organization desires to receive emails for invoices"
   745        email:
   746          type: string
   747          description: "Organization contact email"
   748        tag_expiration:
   749          minimum: 0
   750          type: integer
   751          maximum: 2592000
   752