0
クエリパラメータを使用してAPIを正常に定義しましたが、代わりにすべての状態をJSONオブジェクト経由で渡したかったのです。JSONをインポートしようとしたときにスワッガーエラーが発生しました
私は、次のYAMLファイルに定義している:これは述べてparameters
ラインとエラーになり
paths:
/contact-us:
post:
summary: Contact Us
description: |
Originates a new conversation thread
consumes:
- application/json
parameters:
- in: body
required: true
schema:
$ref: '#/definitions/RequestConversation'
tags:
- Email
responses:
200:
description: New conversation has been originated
schema:
$ref: '#/definitions/Conversation'
を:
Data does not match any schemas from 'oneOf'
しかし、私は同じYAMLファイルに次の定義を持っています:
definitions:
RequestConversation:
type: object
properties:
company_id:
type: string
# required: true
user_email:
type: string
# required: true
type:
type: string
# required: true
default: 'contact-us'
sub_type:
type: string
campaign:
type: string
「必須」の定義は次のとおりです。他のユーザーが私に違うエラーを与えていたからです:
Expected type array but found type boolean
誰かが助けてくれますか?