question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG][JAVA][Spring] Config options for Pageable & ApiIgnore

See original GitHub issue

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • Have you tested with the latest master to confirm the issue still exists?
  • Have you searched for related issues/PRs?
  • What’s the actual output vs expected output?
Description

Trying to generate pure interfaces using next config:

<generateSupportingFiles>false</generateSupportingFiles>
<configOptions>
    <openApiNullable>false</openApiNullable>
    <java8>false</java8>
    <interfaceOnly>true</interfaceOnly>
    <hideGenerationTimestamp>true</hideGenerationTimestamp>
</configOptions>

Following lines are added to generated api file:

import org.springframework.data.domain.Pageable;
import springfox.documentation.annotations.ApiIgnore;

and produced compilation error due those classes needed additional dependencies (spring-data-commons&springfox-core)

Didn’t manage to find any option to disable those imports (like openApiNullable for disabling org.openapitools.jackson.nullable.JsonNullable)

openapi-generator version

5.0.0

OpenAPI declaration file content or url

Sample project for quick reproducing https://github.com/morphlne/openapi-generator-demo

Steps to reproduce

Clone https://github.com/morphlne/openapi-generator-demo.git run mvn compile

Related issues/PRs

Both imports added in mustache files in PR: https://github.com/OpenAPITools/openapi-generator/pull/5022

Suggest a fix

Add support for next config options:

<usePageable>false</usePageable>
<useApiIgnore>false</useApiIgnore>

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:19
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

6reactions
pierrefevriercommented, Feb 19, 2021

Same problem with version 5.0.1

4reactions
morphlnecommented, Feb 16, 2021

@MatCyg As quick solution you can use 5.0.0-beta2 and any earlier version

Read more comments on GitHub >

github_iconTop Results From Across the Web

Swagger documentation for Spring Pageable interface
The issue I have is that the pageable parameter is detected with content-type application/json and I don't know how to pass a value...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found