Hi everyone
I have the following swagger spec:
swagger: '2.0'
info:
title: 'Adviser Service'
version: '1.0.0'
paths:
/api/v1/advisers:
post:
description: Create an `Adviser`
consumes:
- application/vnd.api+json
produces:
- application/vnd.api+json
parameters:
- name: adviser
in: body
required: true
schema:
$ref: '#/definitions/CreateAdviser'
responses:
201:
description: Created
schema:
$ref: '#/definitions/Adviser'
definitions:
CreateAdviser:
properties:
data:
$ref: '#/definitions/CreateAdviserResource'
CreateAdviserResource:
allOf:
- $ref: "#/definitions/AdviserResourceIdentifier"
- type: object
properties:
attributes:
$ref: '#/definitions/CreateAdviserResourceAttributes'
AdviserResourceIdentifier:
required:
- id
- type
properties:
id:
type: string
type:
type: string
enum:
- advisers
CreateAdviserResourceAttributes:
properties:
name:
type: string
description:
type: string
data:
type: string
AdviserResourceAttributes:
properties:
name:
type: string
description:
type: string
Adviser:
properties:
data:
allOf:
- $ref: '#/definitions/AdviserResourceIdentifier'
- type: object
properties:
attributes:
$ref: '#/definitions/AdviserResourceAttributes'
When I view this in editor.swagger.io, the CreateAdviserResource model name
is not displayed in the Models section and instead
AdviserResourceIdentifier is displayed as the model name alongside the
AdviserResourceIdentifier model I am expecting. The definition of the
CreateAdviserResource model looks right, it's just it's name is incorrect
(and duplicated). All the other models look ok.
I'm not sure what I'm doing wrong. Any hints would be much appreciated!
Many thanks
Ben
--
You received this message because you are subscribed to the Google Groups
"Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.