Sign in to follow this  
mstdmstd

ошибки в editor.swagger.io

Recommended Posts

Подскажите,
пытаюсь в http://editor.swagger.io написать описание GET - запроса с необязательным параметром department_id
 

swagger: "2.0"
info:
description: "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters."
version: "1.0.0"
title: "Clients demo"
termsOfService: "http://swagger.io/terms/"
contact:
email: "apiteam@swagger.io"
license:
name: "Apache 2.0"
url: "http://www.apache.org/licenses/LICENSE-2.0.html"
host: "ec2-34-212-140-26.us-west-2.compute.amazonaws.com"
basePath: "/v1"
tags:
- name: "client"
description: "Everything about your Clients demo"
externalDocs:
description: "Find out more"
url: "http://swagger.io"


- name: "department"
description: "Access to departments of Clients demo"
externalDocs:
description: "Find out more about our store"
url: "http://swagger.io"
schemes:
- "http"
paths:
/department/{department_id}:
get:
tags:
- "department"
summary: "Finds departments by department_id or by filters"
description: "Multiple status values can be provided with comma separated strings"
operationId: "findPetsByStatus"
produces:
- "application/xml"
- "application/json"
parameters:
- name: "department_id"
in: "path"
description: "ID of department that needs to be retrieved"
type: "integer"
format: "int64"


responses:
200:
description: "successful operation"
schema:
type: "array"
items:
$ref: "#/definitions/Department"
400:
description: "Invalid status value"
#security:
#- petstore_auth:
# - "write:pets"
# - "read:pets"

post:
tags:
- "department"
summary: "Add a new department to the Clients demo"
description: "Department object(
`department_id` INT(11) - required,
`name` VARCHAR(50) - required,
`is_active` TINYINT(1) - (0/1) - required,
`created_at` - autogenerated,
) that needs to be added to the Clients Demo"
operationId: "addDepartment"
consumes:
- "application/json"
- "application/xml"
produces:
- "application/xml"
- "application/json"
parameters:
- in: "body"
name: "body"
description: ""
required: true
schema:
$ref: "#/definitions/Department"
responses:
405:
description: "Invalid input"
# security:
# - petstore_auth:
# - "write:pets"
# - "read:pets"

definitions:
Department:
type: "object"
properties:
department_id:
type: "integer"
format: "int64"
name:
type: "string"
is_active:
type: "integer"
description: "Order Status"
enum:
- 0
- 1
created_at:
type: "string"
default: false
xml:
name: "Order"



и получаю ошибкиprintscreen:

А как правильно?

Спасибо !
 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Member Statistics

    46,330
    Total Members
    3,128
    Most Online
    TimofejUS
    Newest Member
    TimofejUS
    Joined
  • Recently Browsing   0 members

    No registered users viewing this page.