Comments (7)
One solution would be to have Swagger only when the "development" profile is enabled
from generator-jhipster.
I finished the first step, which is to enable swagger using the swagger-springmvc implementation (https://github.com/martypitt/swagger-springmvc) and it works. The rest methods are exposed in the swagger ui.
One of your need is to offer swagger only during the development phase. My concern is related to the level of documentation that we want to offer. By default, the description of the method is generated based on the name of the method. Not ideal for me. The alternate solution is to add new annotations @ApiOperation for the description, @ApiErrors for the exception or error code etc.
So I don't think we will be able to offer this feature only in development.
What do you think? I will check the memory footprint and the additional libraries later this week
from generator-jhipster.
Yes I'm aware of those annotations: I guess it doesn't work in "prod" mode if the JAR are not available? That's what worries me with Swagger, but let's see the memory footprint first... From my understanding it's quite big, and that's my issue for production.
from generator-jhipster.
Hi (I'd like to work on hipster too, I'm looking at the subgenerators to
write a rest resource with swagger annotations subgenerator)
I dont' think the overhead is very high ; If I understand correctly, in dev
there are 2 parts in swagger : the part that generates the json of the api
of your project and the part that exposes the web page that use the json
api, and in that one it's just a static page that uses javascript and where
you enter the path of the api json to create the forms.
But in my mind, yes the generated services must use annotations, like this :
@get
@path("/")
@ApiOperation(value = "liste les ")
public static Result () {
return ok(Json.toJson(.find.all()));
}
@put
@path("/")
@ApiParamsImplicit(@ApiParamImplicit(value = "param Json a laisser blanc
pour le PUT Swagger", required = false, defaultValue = "{}", dataType =
"String", paramType = "body", name = "Defaut"))
@ApiOperation(value = "cree un ")
public static Result new(
@ApiParam(value = "nom", required = true) @QueryParam("nom") String
nom,
@ApiParam(value = "description", required = true)
@QueryParam("description") String description) {
new (nom, description).save();
return ok();
}
Also don't forget this useful tip that has caused me to scratch my head :
with swagger you can't write a put service without a body, so you have to
use the apiParamsImplicit (but maybe a put without a body is a bad practice)
Mathieu
2013/12/17 Julien Dubois [email protected]
Yes I'm aware of those annotations: I guess it doesn't work in "prod" mode
if the JAR are not available? That's what worries me with Swagger, but
let's see the memory footprint first... From my understanding it's quite
big, and that's my issue for production.—
Reply to this email directly or view it on GitHubhttps://github.com//issues/38#issuecomment-30733833
.
from generator-jhipster.
Perhaps using enunciate with swagger-UI module could be a good deal ?
from generator-jhipster.
I am using the maven swagger plugin to avoid the inclusion of the scala runtime generating the docs at build time, would it be worth to do it in jhipster also?
from generator-jhipster.
@mteodori if we could get rid of Swagger inside JHipster, I would be really happy. This is really a big performance hit.
from generator-jhipster.
Related Issues (20)
- Error creating a basic application with Jhipster 8.3.0 HOT 4
- Unable to start application generated with jhipster 8.3.0 in prod profile HOT 7
- Deleting a Parent isn't working when it has a Child in a one-to-one relationship HOT 4
- Vue: Blank Parent column in Child entity list for both one-to-one and many-to-one relationships HOT 7
- Migrate React to Vite HOT 2
- extract client/vite generator and add support to react.
- Add spring-boot/graalvm generator HOT 1
- org.glassfish.jaxb.runtime.v2.util.StackRecorder: null HOT 1
- Release 8.4.0 HOT 6
- Is the structure of subgenerators a bit fragmented now? HOT 2
- Custom column id as UUID for oracle database
- Use of Spring Boot Parent may break spring.profiles.active HOT 7
- Options generation annotations on entities HOT 1
- Jhipster V794: Entity Creation Fails with Error : An error occured while running jhipster:entity#loadRelationShips HOT 3
- JHipster 8.4.0 Kubernetes Generator Issue HOT 3
- Node throw er; after npm start HOT 3
- `npx jhipster upgrade` doesn't work to upgrade an app from 8.3.0 to 8.4.0 HOT 7
- Not possible to create a uni-directional many-to-one relation with the CLI
- Don't warn about relationships when creating a brand new project
- Questions should follow the same order between major releases
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 generator-jhipster.