GET/DELETE method are not working. POST/PUT method is working. What is the problem?

34 wyświetlenia
Przejdź do pierwszej nieodczytanej wiadomości

Uk Jo

nieprzeczytany,
28 sie 2015, 01:55:0928.08.2015
do Swagger

I am using swagger4spring-web for my application.  Using it, I could expose my rest api to my customer. 
But I faced serious problem. When I adapted this, I was worried about old version and unsolved the issues in the wiki of the github.

Even if I issue this problem, I can't get help. I am urgent.. So I write my problem this user group.

First , I made crud api. and it generated the ui. But If I made json parameter and pushed "try it out" button, It didn't work.
I tried many things. But It failed.  To my surprise, If I change request method to POST, it works very well...

Is it bug? please help me.

    @ApiOperation(value = "TLINK 프로젝트/버젼별 삭제", notes = "TLINK 품질 정보 연계", 
    httpMethod = "POST", consumes = "application/json", produces = "application/json", 
    protocols = "http, https", nickname = "TLINK 품질 정보 삭제", response = TLink.class)
    @ApiResponses(value = {@ApiResponse(code = 500, message = "Process error"),
            @ApiResponse(code = 405, message = "Invalid input"),
            @ApiResponse(code = 415, message = "Bad format")})
    @RequestMapping(method = RequestMethod.POST, produces= "application/json", consumes = "application/json")
    public
    @ResponseBody
    ResponseEntity<String> deleteAPI( 
    @ApiParam(name = "tlink", required = true, value = "TLink")
    @RequestBody TLink tLink  ) {
    logger.info("delete api of TLink is triggered. tlink = {}", tLink.toString());
//     tLink.assembleTransactionInformation(request.getRemoteAddr(), request.getHeader("User-Agent"));
    return delete(tLink);
    }


    @ApiOperation(value = "TLINK 기능적합율 수집 조회", notes = "기능 적합율 복합지표를 위한 TLINK 기능적합율 연계", 
    httpMethod = "GET",  consumes = "application/json",  produces = "application/json",  
    protocols = "http, https", nickname = "T-Link 기능지표 조회", response = TLink.class)
    @ApiResponses(value = {@ApiResponse(code = 500, message = "Process error"),
            @ApiResponse(code = 405, message = "Invalid input"),
            @ApiResponse(code = 415, message = "Bad format")})
    @RequestMapping(method = RequestMethod.GET, produces= "application/json")
    public
    @ResponseBody
    List<TLink> selectAPI(@ApiParam(name = "tlink", required = true, value = "TLink")
    @RequestBody TLink tLink) {
    logger.info("select api of TLink is triggered. tlink = {}", tLink.toString());
    return select(tLink);
    }

Ron Ratovsky

nieprzeczytany,
28 sie 2015, 08:32:1128.08.2015
do Swagger
What do you mean by 'didn't work'? What happened?

--
You received this message because you are subscribed to the Google Groups "Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
-----------------------------------------
http://swagger.io
https://twitter.com/SwaggerApi
-----------------------------------------
Odpowiedz wszystkim
Odpowiedz autorowi
Przekaż
Nowe wiadomości: 0