3
我正在創建一個API定義,我想將我的規範模型分割爲不同的文檔,並使用JSON指針'$ ref'來重用它們。 我需要找到一種方法在YAML文件中添加版本。 例如:我可以將版本添加到YAML Swagger對象嗎?
***pj.yaml***
pJType:
verison: 1.0
type: object
properties:
cnpj:
type: integer
***afastamento.yaml***
oswagger: '2.0'
info:
version: '1.0'
title: AfastamentoService
consumes:
- application/json
produces:
- application/json
paths:
'/{nis}':
get:
parameters:
- in: path
name: nis
type: integer
required: true
responses:
'200':
description: OK
schema:
$ref: '#/definitions/pesquisarResponse'
definitions:
pesquisarResponse:
type: object
properties:
listaAfastamento:
$ref: '#/definitions/listaAfastamentoType'
...
empregadorType:
type: object
properties:
personalidadeJuridica:
type: string
pessoaJuridica:
$ref: pJ.yaml#/pessoaJuridicaType
...