Comments (9)
Generic List<class>
of classes creates correct Result ( case TypeRepresentation.ConcreteTypeRepresentation )
But if Generic List<enum>
holds "enum" , result is wrong.
If Rest Services returns just "enum" Type and not a generic Collection of "enum" like List<enum>
, result is correct.
It looks like the case with TypeRepresentation.EnumTypeRepresentation and generic Collection of "enum" is not working.
from jaxrs-analyzer.
Using javax.ws.rs.core.GenericEntity<List<enum>>
for JAX-RS Service Response also produce wrong Result, just empty reference... in swagger yaml/json
from jaxrs-analyzer.
jars-analyzer version 0.16, running with -b swagger
from jaxrs-analyzer.
Ok, that's interesting... Yes, I think your assumption with EnumTypeRepresentation
goes into the right direction. I don't know if I can find the time to look into it within the next days, but please feel free to verify it using some tests in the mean time :) Have you seen the https://github.com/sdaschner/jaxrs-analyzer-st project? That helps in verifying local builds.
from jaxrs-analyzer.
changing visit(final TypeRepresentation.EnumTypeRepresentation representation)
in SchemaBuilder
has fixed the problem.
Handling in case if inCollection
was not present like in visit(final TypeRepresentation.ConcreteTypeRepresentation representation)
:-)
from jaxrs-analyzer.
@Override
public void visit(final TypeRepresentation.EnumTypeRepresentation representation) {
builder.add("type", "string");
if (!representation.getEnumValues().isEmpty()) {
final JsonArrayBuilder array =
representation.getEnumValues().stream().sorted().collect(Json::createArrayBuilder, JsonArrayBuilder::add, JsonArrayBuilder::add);
//
if (inCollection) {
builder.add("items", Json.createObjectBuilder().add("type", "string").add("enum", array).build());
} else {
builder.add("enum", array);
}
//
}
}
from jaxrs-analyzer.
basically last if else fix it from code above
from jaxrs-analyzer.
Successfully tested with quite complex swagger contract :-)
from jaxrs-analyzer.
from jaxrs-analyzer.
Related Issues (20)
- Model documentation HOT 1
- CompletionStage support
- New Release? HOT 7
- Support for @BeanParam
- analyze-jaxrs failed. ConcurrentModificationException HOT 1
- Could not access static property, reason: com.bam.business.repos.BaseRepoServices HOT 1
- It does not render the Swagger Tags
- @QueryParam() which are not required appear as 'required=true' HOT 2
- Is There a Way to Add the 'summary' tag? HOT 6
- NullPointerException on JavaDocParserVisitor for classes without javadoc
- not an StringLiteralExpException when using a constant in header name
- Maven plugin fails with NullPointerException for module in 0.17, worked in 0.16. HOT 6
- OpenJDK 11: Illegal reflective access
- OpenJDK 11: UnsupportedOperationException HOT 1
- Is there a way to add description to the generated swagger code? HOT 2
- [ERROR] Could not access static property - infinite bulild process
- Jax-RS Analyze Static Property Error HOT 1
- Media type not supported (Javadoc?) HOT 12
- NullPointerException with "JavaDocParserVisitor.calculateMethodIdentifier" HOT 7
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 jaxrs-analyzer.