Bug 描述
Uncaught (in promise) TypeError: Cannot convert undefined or null to object
at Function.keys ()
at importDataTypes (/src/lib/NEI_import/dist/NEISwagger.js:13399)
at /src/lib/NEI_import/dist/NEISwagger.js:13436
导入文件
swagger: '2.0'
info:
version: 1.0.0
title: Simple Artist API
description: A simple API to understand the Swagger Specification in greater detail
schemes:
Bug 描述 Uncaught (in promise) TypeError: Cannot convert undefined or null to object at Function.keys ()
at importDataTypes (/src/lib/NEI_import/dist/NEISwagger.js:13399)
at /src/lib/NEI_import/dist/NEISwagger.js:13436
预期期望 如果是文件格式错误,希望能有个demo参照; 如果格式没有错误,我应该如何使用导入swagger这个功能
导入文件 swagger: '2.0' info: version: 1.0.0 title: Simple Artist API description: A simple API to understand the Swagger Specification in greater detail schemes:
https host: example.io basePath: /v1 securityDefinitions: UserSecurity: type: basic security:
UserSecurity: [] paths: /artists: get: description: Returns a list of artists parameters:
responses: 200: description: Successfully returned a list of artists schema: type: array items: type: object required:
400: description: Invalid request schema: type: object properties:
message: type: string
post: description: Lets a user post a new artist parameters:
name: artist in: body description: creates a new artist in our database schema: type: object required:
responses: 200: description: Successfully created a new artist
400: description: Invalid request schema: type: object properties:
message: type: string
----- Added lines ----------------------------------------
/artists/{username}: get: description: Obtain information about an artist from his or her unique username parameters:
name: username in: path type: string required: true
responses: 200: description: Successfully returned an artist schema: type: object properties: artist_name: type: string artist_genre: type: string albums_recorded: type: integer
400: description: Invalid request schema: type: object properties:
message: type: string
---- /Added lines ----------------------------------------