Add allOf samples to swagger.yml
-swagger: '2.0'
+swagger: "2.0"
info:
title: swagger-test
description: Testing Swagger Codegen
@@ -88,7 +88,7 @@ paths:
200:
description: OK response
schema:
- $ref: '#/definitions/Book'
+ $ref: "#/definitions/Book"
404:
description: Job not found
schema:
@@ -348,3 +348,34 @@ definitions:
type: array
items:
type: string
+
+ Identifiable:
+ type: object
+ properties:
+ id:
+ type: string
+
+ Animal:
+ type: object
+ properties:
+ species:
+ type: string
+ age:
+ type: integer
+
+ Pet:
+ allOf:
+ - $ref: "#/definitions/Animal"
+ - type: object
+ properties:
+ name:
+ type: string
+
+ Dog:
+ allOf:
+ - $ref: "#/definitions/Pet"
+ - $ref: "#/definitions/Identifiable"
+ - type: object
+ properties:
+ breed:
+ type: string
