如何解决带有 Id 的 Swagger Openapi 链接不起作用
我正在拼命地尝试让我的 put 服务发挥作用。 我无法让 movieId 工作的链接。 我想将 movieId 链接到 post(addMovie) 服务或 getMovieById 服务的响应。 但是每次我收到 500 错误。
/movies/{id}:
parameters:
- name: id
in: path
required: true
type: string
get:
tags:
- "Movie"
summary: "Finds Movie by id"
description: "Show movie details"
produces:
- "application/json"
parameters:
- name: "id"
in: "path"
description: "This is the unique identifier for the specific movie"
required: true
type: "string"
responses:
"200":
description: "Successfully fetched Movie."
links:
GetMovieById:
operationId: getMovieId2
parameters:
id: "$response.body#/id"
"404":
description: "Movie not found!"
"500":
description: "Fetching movie Failed!"
put:
tags:
- "Movie"
summary: "Edit and update the selected movie"
description: "This can only be done by the logged in user."
operationId: getMovieId
consumes:
- "application/json"
- "application/x-www-form-urlencoded"
- "multipart/form-data"
produces:
- "application/json"
parameters:
- name: "id"
in: "path"
description: "This is the unique identifier for the specific movie"
required: true
type: "string"
- name: "title"
in: "formData"
description: "movie title"
required: true
type: "string"
- name: "director"
in: "formData"
description: "movie director"
required: true
type: "string"
- name: "genre"
in: "formData"
description: "movie genre"
required: true
type: "string"
- name: "year"
in: "formData"
description: "year of release"
required: true
type: "string"
- name: "poster"
in: "formData"
description: "movie poster"
required: false
type: "file"
responses:
"200":
description: "Successfully updated!"
"500":
description: "Couldn't udpate the movie!"
我的定义:
deFinitions:
Movie:
type: "object"
properties:
title:
type: "string"
director:
type: "string"
genre:
type: "string"
year:
type: "string"
posterPath:
type: "string"
所以 post /movies 和 get /movies 和 get /movies/{id} 正在工作 只有 put 还没有工作。 请问有人可以帮忙吗?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。