Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@requestExample and @responseExample does not seem to work with spring #661

Closed
Amaury-Courjault opened this issue May 19, 2017 · 2 comments
Labels
Milestone

Comments

@Amaury-Courjault
Copy link

Amaury-Courjault commented May 19, 2017

Hi,
I am trying to generate my custom request/response examples (with the new 2.9.1 version) for my spring project and annotation does not seem to be applied to the documentation example section of the request.
Here are the configuration files I am using :

My rest controller :

@RestController
@RequestMapping("/test")
public class TestRestController {

    /**
     * @requestExample application/json { "name" : "TEST" }
     */
    @RequestMapping(value = "/doc", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
    Map<String, String> testDoc(@RequestBody Map<String, String> testBody) {
        return testBody;
    }
}

My enunciate.xml :

<?xml version="1.0" encoding="UTF-8"?>
<enunciate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://enunciate.webcohesion.com/schemas/enunciate-2.9.0.xsd">

    <modules>
        <swagger disabled="true"/>
        <gwt-json-overlay disabled="true"/>
        <java-xml-client disabled="true"/>
        <java-json-client disabled="true"/>
        <c-xml-client disabled="true"/>
        <csharp-xml-client disabled="true"/>
        <javascript-client disabled="true"/>
        <obj-c-xml-client disabled="true"/>
        <php-xml-client disabled="true"/>
        <php-json-client disabled="true"/>
        <ruby-json-client disabled="true"/>
        <idl disabled="true"/>
    </modules>

</enunciate>

Generated doc result :
enunciate

Maybe I am not using the annotation in the right way...

@stoicflame
Copy link
Owner

Bug confirmed. Fixed at d74bc76.

@stoicflame stoicflame added the bug label May 19, 2017
@stoicflame stoicflame added this to the 2.10.0 milestone May 19, 2017
@stoicflame
Copy link
Owner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants