ff4j / ff4j-spring-boot-starter-parent

A spring boot starter for FF4J (Feature Flipping For Java)
Apache License 2.0
32 stars 26 forks source link

Is there a way to disable ff4j swagger documentation? #339

Closed adrianch closed 1 year ago

adrianch commented 1 year ago

Hi,

I'm currently upgrading my application from the ff47 springboot starter 1.8.12 to 1.9. I notice ff4j swagger documentation is taking over my API documentation.

Is there a way to disable ff4j swagger documentation?

Just to let you know, my application is using springfox and from what I understand, ff4j is using springdoc.

paul58914080 commented 1 year ago

Hello @adrianch ,

Have you tried ?

ff4j:
  api:
    spring-doc:
      enabled: false                

Yes ff4j-spring-boot-starter uses springdoc. Do you know which one renders the doc ? springfox or springdoc ?

Reference

adrianch commented 1 year ago

Hi @paul58914080,

Sorry, there was a typo in my original message. I meant to say upgrading from 1.8.12 to 1.9. Unfortunately, adding that config into my yml doesn't work. It's springdoc that renders.

This is a screenshot on 1.8.12

ff4j_1_8_12_swagger

And this is the one from 1.18.13 or 1.9 ff4j_swagger_1_8_13_or_later_

paul58914080 commented 1 year ago

Case 1: Since you mentioned you are using springfox for your api documentation, I believe you can disable springdoc

springdoc:
  swagger-ui:
    enabled: false
  api-docs:
    enabled: false

Reference

And then you can write your own SpringFox configuration to read the path that you are interested in.

Case 2: If you wish to continue with springdoc, then you might ignore the path of ff4j api

springdoc:
  paths-to-exclude: /api/ff4j

And then you could override the OpenApiDefinition. Reference

adrianch commented 1 year ago

Thanks for the suggestions.