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

Does this library work with Non-boot Spring projects? #568

Closed
nzall opened this issue Apr 15, 2020 · 10 comments
Closed

Does this library work with Non-boot Spring projects? #568

nzall opened this issue Apr 15, 2020 · 10 comments
Labels
enhancement New feature or request

Comments

@nzall
Copy link

nzall commented Apr 15, 2020

We have a Spring REST API that we want to automatically generate documentation for. We are currently using Springfox in our development environment (no release version has autogenerated documentation yet), but are investigating migrating to Springdoc because Springfox doesn't seem to be going anywhere with Java 11 compatibility. However, our project does not use Spring-Boot. Has this library been tested yet with non-Spring Boot projects?

@bnasslahsen
Copy link
Contributor

bnasslahsen commented Apr 15, 2020

@nzall,

The library integrates natively with spring-boot.
If you want to use spring, its possible but the integration details will not be covered as it really depends on the version/module and the nature of you spring application.

You can have a look here #250, where there is the steps for some kind of application and sample code using spring without spring-boot.

@nzall
Copy link
Author

nzall commented Apr 15, 2020

@bnasslahsen Thank you for the quick response.

You mentioned in #250 that you will update the FAQ and Stack Overflow. I might be missing the obvious here and my apologies if I do, but I do not see any entry in the FAQ table of contents about using springdoc with a a library without spring boot or anything that looks related. I haven't read the full FAQ yet, but before I fully read through it when I'm starting work again in 8 hours, could you tell me if this promised FAQ update has been completed yet?

@bnasslahsen
Copy link
Contributor

@nzall

Here is the link for the F.A.Q:

As mentionned before, there is no real guide for spring integration. It will give you an idea of the steps to follow.
It really depends on your application context and on the version of spring are using.

@lrozenblyum
Copy link

@bnasslahsen Recently the visibility of configuration classes was reduced
00b2e02
so it's impossible to register part of those classes as described in the FAQ

@bnasslahsen
Copy link
Contributor

@lrozenblyum,

I see and understand.
Will be reverted then for this usage for v1.3.7.

@lrozenblyum
Copy link

Thanks @bnasslahsen !

@bnasslahsen
Copy link
Contributor

@lrozenblyum,

Its now available on master.
If you see any missing class. Don't hesistate to let me know before the next release.

@lrozenblyum
Copy link

Thanks @bnasslahsen it looks like all the needed classes are public again.

@gurmindersing
Copy link

We have a spring webflux reactive application that needs to be deployed as war on server. The spring boot cannot be used as dependency as spring boot does not support spring webflux app deployed as war.

As per solution mention in github ticket to make springdoc work, do we need to add spring boot dependencies?

Is springdoc compatible with non spring boot webflux application?

@bnasslahsen bnasslahsen added the enhancement New feature or request label Jan 10, 2022
@BhargavRuparel3591
Copy link

We have Spring framework (version 5.3.22) based application, not a spring boot.

We have added springdoc-openapi (1.6.11) dependency along with below openapi configuration.

@configuration
@EnableWebMvc
@componentscan(basePackages = {"org.springdoc","rest"})
@import({org.springdoc.core.SpringDocConfiguration.class,
org.springdoc.webmvc.core.SpringDocWebMvcConfiguration.class,
org.springdoc.webmvc.ui.SwaggerConfig.class,
org.springdoc.core.SwaggerUiConfigProperties.class,
org.springdoc.core.SwaggerUiOAuthProperties.class,
org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration.class})
public class OpenApiConfig implements WebMvcConfigurer { }

In our application, we have multiple projects having mixed of Java configurations and XML based configurations.

Both types of classes (java config like @controller/@service and XML definitions like <bean id="".... >) are having dependencies injected through @Autowred.

The classes having beans created through component scanning (@controller/@service) are working well, all the injected dependecies are resolved as expected.
But the classes having XML definitions are having issues, where dependencies injected through setter and bean ref are working fine, but the dependencies injected through @Autowired are found as null at runtime. Looks like @Autowired annotation itself is not getting resolved while creating bean of such classes. We have also verified that our XML context file has <context:annotation-config /> defined and so @Autowired should get resolved here.

Without this springdoc-openpi dependency and these OpenApiConfig, we are not facing this issue.

Does anyone have more insights here ?

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

No branches or pull requests

5 participants