Skip to content
This repository was archived by the owner on Dec 31, 2024. It is now read-only.
This repository was archived by the owner on Dec 31, 2024. It is now read-only.

Could not use@Requestboby annotation for Map,User together with ‘feign-form-spring’ and 'feign-form' #19

Closed
@SoulSong

Description

@SoulSong

When I use ‘feign-form-spring’ and 'feign-form' in my springcloud project.I found that I could not use@Requestboby annotation for Map,User like below:
public String postBobyAParamAPathVar( @RequestBody(required=true) Map<String, Object> map, @RequestParam(value="userName") String userName, @PathVariable(value="id") String id){ ....... }

Activity

xxlabaza

xxlabaza commented on Nov 24, 2017

@xxlabaza
Collaborator

Try to use newer version 3.0.0

this code works there:

Feign client:

  @RequestMapping(
      path = "/multipart/upload4/{id}",
      method = POST,
      produces = APPLICATION_JSON_VALUE
  )
  String upload (@PathVariable("id") String id,
                  @RequestBody Map<Object, Object> map,
                  @RequestParam("userName") String userName);

Spring server:

  @RequestMapping(
      path = "/multipart/upload4/{id}",
      method = POST
  )
  public String upload (@PathVariable("id") String id,
                         @RequestBody Map<String, Object> map,
                         @RequestParam String userName
  ) {
    return userName + ':' + id + ':' + map.size();
  }
SoulSong

SoulSong commented on Jan 16, 2018

@SoulSong
Author

Thanks for reply.It works well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @xxlabaza@SoulSong

        Issue actions

          Could not use@Requestboby annotation for Map,User together with ‘feign-form-spring’ and 'feign-form' · Issue #19 · OpenFeign/feign-form