我在Java源代码中生成了一个OAS Swagger文件。我将此文件上传到editor.swagger.io,并使用所有包含的参数和方法说明以及页面标题进行呈现。
但是,当我将相同的Swagger文件上传到readme.io时,不会出现参数和方法说明以及页面标题。
这是为什么?
这是招摇的文件...
openapi: 3.0.1
info:
title: Foosite API DocumentationB
description: This is documentation for the Foosite API. You can find out more
about Foosite at Foosite.org.
termsOfService: http://foosite.org/terms/
contact:
email: george@aol.com
license:
name: Apache2.0
url: http://www.apache.org/licenses/LICENSE-2.0.html
version: "1.0"
servers:
- url: https://app.foosite.org/api
tags:
- name: Widget
description: Operations about widget
- name: Contact
description: Operations about contacts
externalDocs:
description: More details about the contacts service
url: http://google.com
paths:
/contact/{list_id}/{contact_id}:
get:
tags:
- Contact
summary: Get contact
description: Returns contact with given ID
operationId: getContact
parameters:
- name: list_id
in: path
description: The ID of the list to which the contact belongs
required: true
schema:
type: integer
format: int32
- name: contact_id
in: path
description: The ID of the contact to fetch
required: true
schema:
type: integer
format: int32
responses:
default:
description: The contact object
content:
application/json:
schema:
type: string
400:
description: Contact not found
post:
tags:
- Contact
summary: Update contact
description: Updates a contact with given contact_id in the list with given
list_id
operationId: updateContact
parameters:
- name: list_id
in: path
description: ID of list to which you'd like to add the contact
required: true
schema:
type: integer
format: int32
- name: contact_id
in: path
description: ID of contact you'd like to update
required: true
schema:
type: integer
format: int32
requestBody:
content:
application/json:
schema:
type: object
additionalProperties:
type: object
required: true
responses:
default:
description: default response
content:
application/json:
schema:
$ref: '#/components/schemas/Message'
delete:
tags:
- Contact
summary: Delete contact
description: deletes contact with given contact_id from list with given list_id
operationId: deleteContact
parameters:
- name: list_id
in: path
description: ID of list to which you'd like to add the contact
required: true
schema:
type: integer
format: int32
- name: contact_id
in: path
description: ID of contact you'd like to update
required: true
schema:
type: integer
format: int32
responses:
default:
description: default response
content:
application/json:
schema:
$ref: '#/components/schemas/Message'
/contact/{list_id}:
post:
tags:
- Contact
summary: Create contact
description: Adds a new contact to a list
operationId: createContact
parameters:
- name: list_id
in: path
description: ID of list to which you'd like to add the contact
required: true
schema:
type: integer
format: int32
requestBody:
description: Contact object to create
content:
application/json:
schema:
type: string
required: true
responses:
default:
description: default response
content:
application/json:
schema:
type: object
additionalProperties:
type: object
/widget/{name}:
get:
tags:
- Widget
summary: Get widget
description: This is an example description for the getWidget() method
operationId: getWidget
parameters:
- name: name
in: path
description: 'The name of the widget to fetch '
required: true
schema:
type: string
responses:
default:
description: The test widget
content:
application/json:
schema:
$ref: '#/components/schemas/WidgetObject'
400:
description: Test object not found
/widget/create:
post:
tags:
- Widget
summary: Create a widget object
description: This is a description for the createWidget() method
operationId: createWidget
requestBody:
description: Widget object to create
content:
'*/*':
schema:
$ref: '#/components/schemas/WidgetObject'
required: true
responses:
default:
description: default response
content:
'*/*':
schema:
type: string
components:
schemas:
Message:
type: object
properties:
success:
type: boolean
message:
type: string
statusCode:
type: integer
format: int32
reasonPhrase:
type: string
WidgetObject:
type: object
properties:
testNumber:
type: integer
format: int32
testString:
type: string
欢呼