我的 OpenAPI 规范文件有问题。我试图调用一个暴露的 url 来“获取”一个 id,但是每次我将服务转发到我的本地然后尝试通过 API 文档发送请求时,我的连接都被拒绝了。我将不胜感激任何帮助。我期望的 id 将采用 JSON 格式。下面是我的规格文件
openapi: "3.0.0"
info:
version: 1.0.0
title: Id Generator
servers:
url: www.someurl.com
paths:
/posts:
get:
summary: Get Id
operationId: id
tags:
- posts
responses:
200:
description: successful operation
content:
application/json:
schema:
$ref: "#/definition/Post"
default:
description: unexpected error
content:
application/json:
schema:
$ref: "#/definition/Error"
definition:
Post:
type: object
properties:
id:
type: string
Error:
properties:
id:
type: string