0
내가 자신감 UI를 사용하여 약간의 문제에 직면하고있어 잘 모르겠어요 아직 처리 여부는 버그인지 아닌지 ... Swagger Editor를 사용하여 열거 형 매개 변수가 포함 된 메서드가 있습니다.자신감 UI 모델에 열거 값을 표시하지 않습니다 내 API를 설명했습니다</p> <p>
문제 : Swagger-UI 설명서에서 생성 된 '모델'탭에서 'messageType'개체에 대한 빈 정의가 있습니다. (허용 된 값 (BRAND, VISITOR, COMMENT)을 표시하고 싶습니다. 및 응답)
코드 조각은 재현 :
swagger: '2.0'
info:
version: 1.0.0-SNAPSHOT
title: foo
description: foo
host: dev.fr
basePath: /base
schemes:
- http
- https
consumes:
- application/json
produces:
- application/json
paths:
/social/message:
post:
operationId: create
responses:
'201':
schema:
$ref: '#/definitions/message'
'default':
description: Default error response
definitions:
message:
required:
- title
- messageType
properties:
title:
type: string
messageType:
$ref: '#/definitions/messageType'
messageType:
enum:
- COMMENT
- RESPONSE
어떤 생각 나는 그것이 잘못된 일을 오전이 버그가 많은 감사합니다 :)
,691를?
'messageType'은'type'을 선언하지 않습니다. 'enum'은 JSON 스키마에서 유효한 유형이 아닙니다. 열거 형에'type : string'을 형제로 추가하는 것을 고려하십시오. – fehguy
당신은 편안합니다! 감사 :) – hiveship