I noticed a difference in the Swagger file genererated when I switch from Yaml to Json format and vice versa. Both seem to be incomplete in the way that they lack the definition of the Album entity causing the Swagger output description to be incomplete ("null")
Error Message "required: &2 !!perl/scalar:JSON::PP::Boolean 1" in line 60
Missing definition of Album
Strange trailing hex codes in the object names. (why are they necessary? Names should be unique anyway)
basePath: /
consumes: &1
- application/x-yaml
- application/json
definitions:
MusicApp::Entity::Artist-302668EB84:
properties:
albums:
items:
$ref: '#/definitions/MusicApp::Entity::Album-AFC2856845'
type: array
artist:
description: Artist name
type: string
hash:
description: ID*10
type: string
id:
description: ID
format: int32
type: integer
name:
description: Artist name /shown only if it equals to Nirvana/
type: string
required:
- id
- name
- artist
- hash
- albums
type: object
host: localhost:5004
info:
title: API
version: 0.0.1
paths:
/albums:
get:
consumes: *1
description: ''
operationId: get_albums
produces: *1
responses:
default:
description: Unexpected error
summary: List
tags:
- albums
'/albums/{id}':
get:
consumes: *1
description: ''
operationId: get_albums__id
parameters:
- description: ''
format: int32
in: path
name: id
required: &2 !!perl/scalar:JSON::PP::Boolean 1
type: integer
produces: *1
responses:
default:
description: Unexpected error
summary: ''
tags:
- albums
/artists:
get:
consumes: *1
description: ''
operationId: get_artists
produces: *1
responses:
200:
description: List
schema:
$ref: '#/definitions/MusicApp::Entity::Artist-302668EB84'
default:
description: Unexpected error
summary: List
tags:
- artists
'/artists/{id}':
get:
consumes: *1
description: ''
operationId: get_artists__id
parameters:
- description: ''
format: int32
in: path
name: id
required: *2
type: integer
produces: *1
responses:
200:
description: ''
schema:
$ref: '#/definitions/MusicApp::Entity::Artist-302668EB84'
default:
description: Unexpected error
summary: ''
tags:
- artists
produces: *1
schemes:
- http
security: []
securityDefinitions: {}
swagger: 2.0
tags:
- description: Artist API
name: artists
- description: Albums API
name: albums
The first complain is about the line 60:
required: &2 !!perl/scalar:JSON::PP::Boolean 1
which is: unknown tag !<tag:yaml.org,2002:perl/scalar:JSON::PP::Boolean>
We have a definition of the Entity usicApp::Entity::Artist-302668EB84 which references the definition for the nested object Albums which links here
/definitions/MusicApp::Entity::Album-AFC2856845'
but the corresponding definition for Album doesn't exist.
Json
The Json Representation of the same application causes an additional complains about
Semantic error at definitions.MusicApp::Entity::Artist-302668EB84.properties.albums.items.$ref
$refs must reference a valid location in the document
Jump to line 24
due to the quoting of the object names. (probably comes from the fact that Json requires quoting)
The definition for the Album entity is missing here too.
I noticed a difference in the Swagger file genererated when I switch from Yaml to Json format and vice versa. Both seem to be incomplete in the way that they lack the definition of the Album entity causing the Swagger output description to be incomplete ("null")
YAML:
The first complain is about the line 60:
required: &2 !!perl/scalar:JSON::PP::Boolean 1
which is: unknown tag !<tag:yaml.org,2002:perl/scalar:JSON::PP::Boolean>
We have a definition of the Entity usicApp::Entity::Artist-302668EB84 which references the definition for the nested object Albums which links here
/definitions/MusicApp::Entity::Album-AFC2856845'
but the corresponding definition for Album doesn't exist.
Json
The Json Representation of the same application causes an additional complains about
due to the quoting of the object names. (probably comes from the fact that Json requires quoting)
The definition for the Album entity is missing here too.