Open miguelvaladez opened 7 years ago
@miguelvaladez thanks for enhancing the generator. Is your work related to the discussion in https://github.com/swagger-api/swagger-codegen/issues/4044 ?
Not really no - mine is much more slimmed down but also reliant on the client code being used in an Angular environment.
The API would return a resource class like this:
` export default class AuthApi { / @ngInject / constructor($resource) { this.basePath = 'http://myapp.dev/api/auth';
return $resource(null, {}, {
'login': this.login(),
});
}
/**
* logs a user in
*/
login () {
return {
method: 'POST',
url: this.basePath + '/login'
}
}
}
`
Is it correct to say that your version is tailored made to JS ES6 and Angular 1.x?
Any chance this can be added back to the JS generator via CLI option (e.g. supportAngular) (or {{#supportAngular}} in the mustache template)? We would like to avoid generators with very similar functionality if possible because it becomes not easy to maintain generators with similar functionality.
Can you please also file a PR so that we can review the exact enhancement?
I did not see an open issue or request for this and have since forked this project to begin working on it. I have implemented a Javascript-ES6-Angular client generator that turns the API data into a basic Angular $resource and imports them into a base module.js file. Would anyone else be interested in this functionality or in helping contribute to what I've done so far?