Comments (10)
Any news about it?
i have all my REST services under http://localhost/rest/\* and i cannot document any of them.
thanks
from springfox.
Same here. Any updates on this?
from springfox.
@ankurvsoni @Miamoto-Musashi This issue should be fixed now. Do let me know if it doesnt work for you.
from springfox.
@dilipkrish will check it out. Is there an official version where the fix is available?
from springfox.
Version 0.3.0 has just been released, should sync to maven central shortly.
Please test, and close this bug if resolved.
from springfox.
I see /api-docs and /api-docs/** mapped. /api-docs works fine. But if I try to access one of my api's i.e. /api-docs/api/pets - I get:
Caused by: java.lang.IllegalArgumentException: Class org.springframework.web.util.UriComponentsBuilder would not be serialized as a JSON object and therefore has no schema
at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.generateJsonSchema(DefaultSerializerProvider.java:260)
at com.fasterxml.jackson.databind.ObjectMapper.generateJsonSchema(ObjectMapper.java:2539)
at com.mangofactory.swagger.ControllerDocumentation$1.apply(ControllerDocumentation.java:84)
at com.mangofactory.swagger.ControllerDocumentation$1.apply(ControllerDocumentation.java:76)
at com.google.common.collect.Maps$2.transformEntry(Maps.java:1252)
at com.google.common.collect.Maps$TransformedEntriesMap$1$1$1.getValue(Maps.java:1542)
at java.util.HashMap.putAllForCreate(HashMap.java:534)
at java.util.HashMap.(HashMap.java:320)
at com.google.common.collect.Maps.newHashMap(Maps.java:144)
at com.mangofactory.swagger.ControllerDocumentation.getModels(ControllerDocumentation.java:76)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.get(BeanPropertyWriter.java:653)
at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:509)
at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:551)
... 42 more
Not sure what might be causing this?
from springfox.
Most likely you have UriComponentsBuilder as a method parameter which isn't really a model and we cannot infer the schema. Try adding UriComponentsBuilder to the ignorableParameterTypes collection to the swagger configuration extension bean … I think that should fix your problem
Example below:
<bean id="swaggerConfiguration" class="com.mangofactory.swagger.SwaggerConfiguration">
<property name="basePath" value="${service.documentation.base-url}"/>
…
…
from springfox.
Thanks. With minor modification I was able to get this working. However, I see another issue - When I access
http://localhost:8080/example-service/api-docs - I get:
{"apiVersion":"1.0","swaggerVersion":"1.0","basePath":"http://localhost:8080/example-service","apis":[{"path":"/api-docs/api/examples"}]}
But for - http://localhost:8080/example-service/api-docs/api/examples - I get:
{"apiVersion":"1.0","swaggerVersion":"1.0","basePath":"http://localhost:8080/example-service","resourcePath":"api/examples","models":{}}
I don't any "apis" here. Any ideas why?
Thanks!
from springfox.
Thats not enough information for me to tell whats going on. Possibly your controller methods do not have a request mapping annotation? May be posting your controller class might help. In any case, If your original problem has been fixed please move to close this open bug and open a new bug for the scenario you're now having.
from springfox.
This bug should be fixed
from springfox.
Related Issues (20)
- Swagger ui updated to from 2.8.0 to 3.0.0 .But previous endpoints not working HOT 1
- springfox.documentation.swagger2.web.WebMvcBasePathAndHostnameTransformationFilter imports javax.servlet.http.HttpServletRequest HOT 2
- Unable to infer base url. HOT 1
- Is this project still alive? or is there any plan to release a new version HOT 3
- Incompatible because this component declares a component compatible with Java 11 and the consumer needed a component compatible with Java 8
- Bump Swagger UI Dependency to latest
- springfox-swagger-ui/-boot-starter not found
- WebMvcRequestHandlerProvider should not use @Component HOT 1
- How to add common headers using spring fox 3
- swagger2+nginx reports 404 problem when accessing swagger
- When there are 20,000 controllers, the startup time exceeds two hours.
- Can we use springfox with springboot 3.1.4?? Or any version of springfox is compatible with springboot 3.1.4 HOT 2
- Any springfox version compatible with springboot 3???? HOT 3
- Swagger UI not Showing Map<String, Object> myField ?
- Description of ResponseHeader is blank
- The launch is just around the corner HOT 3
- Need similar way for Open API
- Unable to Access Swagger-UI After Implementing Spring Security Configuration HOT 2
- error and exception`documentationPluginsBootstrapper` when configuring it to my springboot project HOT 4
- Failed to convert value of type 'java.lang.String' to required type 'int'; For input string: "load_form"]
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from springfox.