Skip to content

[JAVA SPRING] Error while generating server with PATCH method #5137

@triet96

Description

@triet96
Description

I have the following API in Yaml. When I tried to generate the server in Java Spring, I get this error



Unable to build target: Could not process operation: Tag: default Operation: null Resource: patch /users/{username}/links Definitions: {User=io.swagger.models.ModelImpl@6afdffbd, User_Link=io.swagger.models.ModelImpl@84c80ee2, Trip=io.swagger.models.ModelImpl@3c27977d, Trip_Link=io.swagger.models.ModelImpl@d8e0d2d9, Point=io.swagger.models.ModelImpl@91222ea1, Point_Link=io.swagger.models.ModelImpl@37bc12d4, Photo=io.swagger.models.ModelImpl@fbaa5cbe, Photo_Link=io.swagger.models.ModelImpl@a48b5046, Error=io.swagger.models.ModelImpl@5d85c8b4} Exception: null

Details:
Object
code: 1
type: "error"
message: "Unable to build target: Could not process operation:
  Tag: default
  Operation: null
  Resource: patch /users/{username}/links
  Definitions: {User=io.swagger.models.ModelImpl@6afdffbd, User_Link=io.swagger.models.ModelImpl@84c80ee2, Trip=io.swagger.models.ModelImpl@3c27977d, Trip_Link=io.swagger.models.ModelImpl@d8e0d2d9, Point=io.swagger.models.ModelImpl@91222ea1, Point_Link=io.swagger.models.ModelImpl@37bc12d4, Photo=io.swagger.models.ModelImpl@fbaa5cbe, Photo_Link=io.swagger.models.ModelImpl@a48b5046, Error=io.swagger.models.ModelImpl@5d85c8b4}
  Exception: null"

I suspect that it is because of the patch_document parameter in my api description. The patch_document parameter is in the body of the request, but then the schema could be arbitrary so I decided not to explicitly describe it. The online UI editors works completely fine with this.

Swagger-codegen version

The online generator

Swagger declaration file content or url

yaml file

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions