swagger-maven-plugin нет определения сгенерированных входных объектов - PullRequest
0 голосов
/ 16 октября 2018

Я пытаюсь сгенерировать swagger.json из следующего, используя swagger-maven-plugin:

@Timed
    @Path("_list")
    @POST
    @Produces(UTF8JSON)
    @Consumes(UTF8JSON)
    @ApiOperation(value = "List", produces = UTF8JSON, notes = "List the Scenes, given the filters", consumes = UTF8JSON, response = Scene.class)
    @ApiResponses(value =
            {@ApiResponse(code = 200, message = "Successful operation", response = Scene.class, responseContainer = "Object"),
            @ApiResponse(code = 500, message = "Server Error.", response = Error.class),
            @ApiResponse(code = 400, message = "Bad request.", response = Error.class)})
    public Response list(
            // --------------------------------------------------------
            // -----------------------  FORM    -----------------------
            // --------------------------------------------------------
            @ApiParam(name = "pretty", value = Documentation.FORM_PRETTY,
                    allowMultiple = false,
                    defaultValue = "false",
                    required = true,
                    type = "Search")
            @QueryParam(value = "pretty") Boolean pretty,

            // --------------------------------------------------------
            // -----------------------  SEARCH  -----------------------
            // --------------------------------------------------------
            @ApiParam(name = "search",
                    value = "The search",
                    allowMultiple = false,
                    required = true)
            @QueryParam(value = "search")
            Search search
    ) throws InterruptedException, ExecutionException, IOException, NotFoundException, IllegalArgumentException {

Затем в maven я просто задаю:

            <plugin>
                <groupId>com.github.kongchen</groupId>
                <artifactId>swagger-maven-plugin</artifactId>
                <version>${swagger-maven-plugin.version}</version>
                <configuration>
                    <apiSources>
                        <apiSource>
                            <locations>
                                <location>com.my.project.rest.server</location>
                            </locations>
                            <info>
                                <title>${swagger.rest.title}</title>
                                <version>${project.version}</version>
                            </info>
                            <swaggerDirectory>${project.build.directory}</swaggerDirectory>
                        </apiSource>
                    </apiSources>
                </configuration>
                <executions>
                    <execution>
                        <phase>compile</phase>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

Моя проблемачто в произведенном swagger.json определения объекта поиска нет.Когда я генерирую код клиента с помощью swagger-codegen-maven-plugin, я не могу запросить, потому что поиск отсутствует.

Когда я смотрю на swagger runtime, сгенерированный swagger.json, с определением все в порядке.Чего мне не хватает, чтобы он генерировал также объекты входных параметров?

Thx.

...