yaml - Openapi 3.0:有效负载不反映我的架构 allOf
问题描述
我有一点麻烦:在 yaml 中,我将创建一个包含一些文件的通用模式。然后我会在各种 PUT\POST 调用中引用它。在每个 put\post 中,我将创建一个专门针对这个特定模式的 allOf。所以,就立场而言,这是我的模式
site:
type: object
properties:
id:
type: integer
readOnly: true
description:
type: string
idLicensee:
type: integer
uId:
type: string
active:
type: boolean
lastupdate:
type: string
format: date-time
readOnly: true
这是我的 PUT
put:
tags:
- sites
operationId: editSite
parameters:
- name: id
in: path
description: "id of the object to be removed"
required: true
schema:
type: integer
requestBody:
description: "Use this message to edit an existing site"
content:
application/json:
schema:
allOf:
- type: object
properties:
uId:
readOnly: true
idLicensee:
readOnly: true
- required:
- description
- active
- $ref: '#/components/schemas/site'
现在我终于在我编译的文档中看到了一个正确的请求正文,只需要 2 个字段,同时使用一个类似的 sitanx,我可以创建一个正确的 POST whit 4 所需的字段。
我的有效负载没有反映 allOf “覆盖”(对不起,我是初级开发人员 < 1y),但坚持使用一般模式。我什至不知道是否是openapi“错误”,个人对Payload的误解或编译错误。请问是否有关于openapi和Payload whit allof的已知问题?真挚地
解决方案
推荐阅读
- hangouts-chat - 带 out bot 的 Google Hangout 聊天数据
- java - 如何在JDK11中信任通配符DNS *?
- google-apps-script - 如何在 Google Apps Script 中知道 UrlFetchApp 的 IP?
- curl - CURL7.76.0 curl:未知--写出变量:'errormsg'
- javascript - 正则表达式 - 匹配一个单词,只要它不在引号中
- grafana - 计算grafana中两个查询之间的差异
- python - Pygame 允许缩放窗口
- r - Cohen d 配对样本因子和数据长度不等
- sdk - 在 Mac 上的 gmp 编译 eep-open-sdk 的问题
- apache-kafka-streams - Confluent 教程:空结果