对于客户端,这个客户端位于client.yaml
中const el = document.getElementById('conteudo_pagina_quantidade' + i);
const clr = window.getComputedStyle(el).getPropertyValue("color");
对于USER,这是在user.yaml
中/clients:
get:
tags:
- "Clients"
description: "List Clients The list capability"
produces:
- "application/json"
parameters:
- name: "tenantIdentifier"
in: "query"
required: true
type: "array"
items:
type: "string"
enum:
- "default"
responses:
200:
description: "successful operation"
400:
description: "Invalid status value"
security:
- basicAuth: []
post:
tags:
- "Clients"
summary: "Create client if address is enabled"
description: ""
operationId: "addClient"
consumes:
- "application/json"
produces:
- "application/json"
parameters:
- name: "tenantIdentifier"
in: "query"
description: ""
required: true
type: "array"
items:
type: "string"
enum:
- "default"
- in: "body"
name: "body"
description: "Add what do you wnat to add "
required: true
schema:
allOf:
- $ref: '#/definitions/ClientStructure1'
- $ref: '#/definitions/ClientStructure2'
- $ref: '#/definitions/ClientStructure3'
responses:
405:
description: "Invalid input"
security:
- basicAuth: []
答案 0 :(得分:1)
您不能$ref
整条路径,但可以$ref
个别路径的内容。在您的示例中,您可以使用:
paths:
/clients:
$ref: clients.yaml#/~1clients
/users:
$ref: users.yaml#/~1users
clients.yaml#/~1clients
表示我们获取clients.yaml
文件,然后读取该文件中/clients
节点的内容,并用$ref
替换该内容。根据JSON指针规则,~1clients
为/clients
,/
转义为~1
。
要简化引用,您可以从/clients:
和/users:
文件中删除clients.yaml
和users.yaml
个节点
# clients.yaml
get:
description: "List Clients The list capability"
...
post:
summary: "Create client if address is enabled"
...
然后使用
paths:
/clients:
$ref: clients.yaml
/users:
$ref: users.yaml
答案 1 :(得分:0)
OpenAPI 3允许使用$ ref关键字: