Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Responds with the actual schema instead of faked array of objects #11

Open
netmilk opened this issue Oct 23, 2018 · 1 comment
Open

Comments

@netmilk
Copy link

netmilk commented Oct 23, 2018

Querying curl localhost:8883/persons using following Open API 2 document:

swagger: "2.0"

info:
  version: 1.0.0
  title: Simple API
  description: A simple API to learn how to write OpenAPI Specification

schemes:
  - https

host: simple.api
basePath: /


paths:
  /persons:
    get:
      summary: Gets some persons
      description: Returns a list containing all persons.
      responses:
        200:
          description: A list of Person
          schema:
            type: array
            items:
              required:
                - username
              properties:
                firstName:
                  type: string
                lastName:
                  type: string
                username:
                  type: string

it responds with this body:

[
	{
		"type": "object",
		"required": [
			"username"
		],
		"properties": {
			"firstName": {
				"type": "string"
			},
			"lastName": {
				"type": "string"
			},
			"username": {
				"type": "string"
			}
		}
	},
	{
		"type": "object",
		"required": [
			"username"
		],
		"properties": {
			"firstName": {
				"type": "string"
			},
			"lastName": {
				"type": "string"
			},
			"username": {
				"type": "string"
			}
		}
	},
	{
		"type": "object",
		"required": [
			"username"
		],
		"properties": {
			"firstName": {
				"type": "string"
			},
			"lastName": {
				"type": "string"
			},
			"username": {
				"type": "string"
			}
		}
	},
	{
		"type": "object",
		"required": [
			"username"
		],
		"properties": {
			"firstName": {
				"type": "string"
			},
			"lastName": {
				"type": "string"
			},
			"username": {
				"type": "string"
			}
		}
	},
	{
		"type": "object",
		"required": [
			"username"
		],
		"properties": {
			"firstName": {
				"type": "string"
			},
			"lastName": {
				"type": "string"
			},
			"username": {
				"type": "string"
			}
		}
	}
]
@vroudge
Copy link
Contributor

vroudge commented Oct 23, 2018

This is indeed a bug. @leboncoin won't do anything about it I think, though. You might want again to submit a PR on that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants