You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
UserSecurity: []
paths:
/artists:
get:
description: Returns a list of artists
parameters:
- name: limit
in: query
type: integer
description: Limits the number of items on a page
- name: offset
in: query
type: integer
description: Specifies the page number of the artists to be displayed
responses:
200:
description: Successfully returned a list of artists
schema:
type: array
items:
type: object
required:
- username
properties:
artist_name:
type: string
artist_genre:
type: string
albums_recorded:
type: integer
username:
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:
- username
properties:
artist_name:
type: string
artist_genre:
type: string
albums_recorded:
type: integer
username:
type: string
responses:
200:
description: Successfully created a new artist
/artists/{username}:
get:
description: Obtain information about an artist from his or her unique username
parameters:
- name: username
in: path
type: string
required: true
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:
- name: limit
in: query
type: integer
description: Limits the number of items on a page
- name: offset
in: query
type: integer
description: Specifies the page number of the artists to be displayed
responses:
200:
description: Successfully returned a list of artists
schema:
type: array
items:
type: object
required:
- username
properties:
artist_name:
type: string
artist_genre:
type: string
albums_recorded:
type: integer
username:
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:
- username
properties:
artist_name:
type: string
artist_genre:
type: string
albums_recorded:
type: integer
username:
type: string
responses:
200:
description: Successfully created a new artist
----- 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
---- /Added lines ----------------------------------------
The text was updated successfully, but these errors were encountered: