Skip to content
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

Add basic Javascript SDK support #1671

Merged
merged 16 commits into from
Dec 7, 2015
Merged

Add basic Javascript SDK support #1671

merged 16 commits into from
Dec 7, 2015

Conversation

jfiala
Copy link
Contributor

@jfiala jfiala commented Dec 5, 2015

see also issue #1294 "Document client SDK"

Add basic Javascript SDK support

(based on the Java templates):

  • Allow to generate model classes
    • including comments
    • including property-level comments + type hints
    • including getters & setters + comment type hints
    • generate inline Enumeration classes to allow Enumeration usage
    • add required parameters to default constructor
    • add .toJson() to print complete model including nested models
  • Allow to generate API classes
    • including comments
    • including JSDoc for params & return
  • Allow for both AMD + plain JS usage

@jfiala jfiala changed the title Add basic JS SDK support, see Document client SDK #1294 Add basic Javascript SDK support, see Document client SDK #1294 Dec 5, 2015
@jfiala jfiala changed the title Add basic Javascript SDK support, see Document client SDK #1294 Add basic Javascript SDK support Dec 5, 2015
Conflicts:
	modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavascriptClientCodegen.java
@jfiala
Copy link
Contributor Author

jfiala commented Dec 5, 2015

Only added new class "JavascriptClientCodegen", but it seems all classes implementing CodegenConfig are tested using their name.

However, I ran it using the full class invocation:
-l io.swagger.codegen.languages.JavascriptClientCodegen

The shorthand "javascript" didn't work:
-l javascript

Please advise how to add a new language only by implementing interface CodegenConfig without breaking the tests.

@jfiala jfiala mentioned this pull request Dec 5, 2015
@wing328
Copy link
Contributor

wing328 commented Dec 6, 2015

@jfiala thanks for the PR to add Javascript SDK :)

To add a new language, please add the following line to modules/swagger-codegen/src/main/resources/META-INF/services/io.swagger.codegen.CodegenConfig:

io.swagger.codegen.languages.JavascriptClientCodegen

I did a test and no longer see the same error after adding the line above.

@jfiala
Copy link
Contributor Author

jfiala commented Dec 6, 2015

added configuration entry in io.swagger.codegen.CodegenConfig, however it could be picked up automatically as it implements the interface CodegenConfig

The shorthand -l javascript is working now.

@wing328 wing328 added this to the v2.1.5 milestone Dec 6, 2015
@wing328
Copy link
Contributor

wing328 commented Dec 7, 2015

Agree with you that ideally it should be picked up automatically.

wing328 added a commit that referenced this pull request Dec 7, 2015
Add basic Javascript SDK support
@wing328 wing328 merged commit e2679b2 into swagger-api:master Dec 7, 2015
@wing328
Copy link
Contributor

wing328 commented Dec 7, 2015

@jfiala thanks again for your contribution of the JS SDK. I'm sure the community would appreciate your effort 🍻

@wing328 wing328 mentioned this pull request Dec 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants