Skip to content

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

@netmilk

Description

@netmilk

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"
			}
		}
	}
]

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions