gpt4 book ai didi

css - Swagger json 编辑器 : undefiend Error

转载 作者:行者123 更新时间:2023-11-28 08:35:46 25 4
gpt4 key购买 nike

当我使用 Swagger Editor 时,我在渲染中遇到一个未定义的错误

我的代码在这里:

swagger: '2.0'
info:
version: 1.0.0
title: AccountBalance
host: localhost:2625
basePath: /accountbalance
schemes:
- http
- https
consumes:
- application/json
- text/xml
produces:
- application/json
- text/html
paths:
/:
get:
parameters:
- name: acc
in: query
description: acc
type: integer
format: long

responses:
200:
description: List all AccBal
schema:
title: acc
type: array
items:
$ref: '#/definitions/accountbalance'

definitions:
accountbalance:
properties:
Balance:
type: integer

最佳答案

definitions: 对象应该在根级别

swagger: '2.0'
info:
version: 1.0.0
title: AccountBalance
host: localhost:2625
basePath: /accountbalance
schemes:
- http
- https
consumes:
- application/json
- text/xml
produces:
- application/json
- text/html
paths:
/:
get:
parameters:
- name: acc
in: query
description: acc
type: integer
format: long

responses:
200:
description: List all AccBal
schema:
title: acc
type: array
items:
$ref: '#/definitions/accountbalance'
definitions:
accountbalance:
properties:
Balance:
type: integer

关于css - Swagger json 编辑器 : undefiend Error,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28045289/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com