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
...