-
Notifications
You must be signed in to change notification settings - Fork 6k
Add Closure annotated Javascript Angular generator #1997
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
Conversation
@achew22 thanks for the PR. Here are some feedbacks/suggestions:
- create a shell script under
./bin/to generatejavascript-closure-angularfor Petstore undersamples/client/petstore/javascript-closure-angular - add test cases for javascript-closure-angular petstore samples. You can refer to test cases in other programming languages under the petstore folder as a reference. A good starting point is to cover GET, POST (HTTP form, JSON model), DELETE.
13c284a to
af6926b
Compare
Doing the first bullet revealed something curious. Do you have any idea why it it is trying to import java.util.List?
I think that's because you're using the default (Java) import mapping and would suggest you look at Go implementation for the imports: https://github.com/swagger-api/swagger-codegen/blob/master/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/GoClientCodegen.java#L94
@achew22 if you need further assistance on the import mapping, please let me know.
Funny you should mention. I managed to get the imports working for the most part. However, I'm curious how I would tell it that "binary" should be a "Blob" object? Do you have any ideas on that?
Please set a typeMapping for binary, e.g.
typeMapping.put("binary", "string");
(binary format is something we recently working on)
would also be nice if you can change the indention in JavascriptClosureAngularClientCodegen.java from 2-space to 4-space.
@achew22 are you still facing issue with binary and Blob?
Sorry this took me so long to get back to you. I was traveling all weekend (and again starting tomorrow). What do you think about this?
This outputs totally valid Closure compiler compatible Javascript. There are a few cleanup things that can be done that will make the output cleaner. There might even be a few tricks that can make it compile even smaller, but I won't know till I get down into the weeds and start using this in a project. In my purely synthetic tests this was pretty good, but there is always room for improvement.
I'm going to be using these in a project I'm working on so please expect a follow-up if I find anything I can improve.
@achew22 My recommendation is to release your current working version of javascript-closure-angular and document what you think can be improved so that the community can help on that as well.
Just for reference I believe this code is good to go. I don't explicitly know what kind of optimizations are going to be available without using it in a project for real so I don't think there is anything to document. Could you please take a look at the PR?
@achew22 thanks again for the contribution 🍻
PR merged into master.
Add Closure annotated Javascript Angular generator
No description provided.