Comments (23)
Is there any update on this? Would it be possible to document the fact that nodejs-server doesn't work with 3.0 specs somewhere more obvious? I just wasted more time than I'd like to admit because of this.
from openapi-generator.
Hello,
When are you guys planning to release support for NodeJS?
Thanks
from openapi-generator.
Totally agree with creating another NodeJS server generator for other frameworks and later mark "nodejs-server" as deprecated.
from openapi-generator.
Hi all,
I've filed #2566 to add a new NodeJS (Fastify) server generator as an alternative as the existing NodeJS server generator won't work due to limitations in the dependency (not supporting OpenAPI v3).
It's still work-in-progress but worth sharing here to start collecting feedbacks.
Please check it out when you've time.
Thanks,
William
from openapi-generator.
Is this still an issue given that a NodeJs server has been added? Note that I cannot still get the new nodejs server to run.
from openapi-generator.
Still no progress. Just used the JAR on command line and got the same output as @ackintosh :-(
cc @emilianobonassi @CodeNinjai @frol @cliffano (TechnicalCommittee)
from openapi-generator.
@wing328 , @ackintosh, @emilianobonassi , with regard to an alternative OpenAPI v3 parser and object representation: you might want to look at KaiZen OpenAPI Parser.
It's written in Java, but it also includes its own metadata description of an OAS3 object model, with mappings to the JSON/YAML representation of an OAS3 document. The classes and parsing logic are all driven from this declarative configuration file. I believe most of that code generation and runtime serialization/deserialization are handled by a related project called JSON Overlay.
It might be practical for you to port this to JavaScript/NodeJS, generating code from the same metadata format. Both KaiZen Parser and JSON Overlay were written by @andylowry , who might be able to provide some pointers if you decide to try this approach.
from openapi-generator.
@ackintosh , I agree with you, we should absolutely remove swagger-tools
dependency from this generator. Around there's some work, e.g. https://github.com/atlassian/koa-oas3 (in TypeScript)
We can draft a new Node.js gen.
from openapi-generator.
Is there any work in progress regarding this issue? I defined my API (OAS 3.0) in swagger with the assumption that the code generation works as the openapi-generator documentation states.
If a generator is not supported or erroneous, it maybe would help to remove it from the list of supported generators in the documentation.
Giving hints on the start pages of swagger.io and/or openapi-generator.tech would help as well. At least a warning which states: "Warning: Check support of target code generator." or similar.
from openapi-generator.
I have forked both openapi-generator and oas3-tools and made just enough changes to get it working for my case. It is relatively untested and I make no guarantees that it will solve others' problems, but you might like to have a look at the changes and/or use it:
ellipsistechnology/openapi-generator
ellipsistechnology/oas3-tools
from openapi-generator.
Please check out the branch nodejs-express-server
(alpha) and let us know if you've any feedback.
Thanks @YishTish for contributing the new generator.
from openapi-generator.
Added nodejs-express-server
generator (included in v4.1.0 release).
from openapi-generator.
@emilianobonassi Thanks for the suggestion!
I searched for other Node.js libraries, but no one corresponding to OAS3 was found. 👀 (There are some works that supports OAS2, but those were not updated)
from openapi-generator.
@ackintosh, I've looked and I got the same result.
IMHO, we should write from scratch a library for oas3. I think that should be a good idea to take https://github.com/atlassian/koa-oas3 as an example.
We could also think to transpile that library to javascript using tsc
from official npm package typescript.
Anyway, I think the best idea is the first one. What do you think?
from openapi-generator.
The first one looks good to me, too.
However, I can not imagine how difficult it is to write a library from scratch since I'm not so familiar with javascript. 💦
(I think "transpile the library to javascript" or "new Node.js gen with koa-oas3" will be option if the first one is too hard.)
from openapi-generator.
@ackintosh it is not so difficult, it can be a good exercise.
We could proceed with both, one of us go for transpilation and the other one for scratch.
What do you prefer?
from openapi-generator.
Unfortunately no updates. 😢
Quick idea: what about displaying notification message on generating the Node.js server like below?
$ java -jar ......... -g nodejs-server
Currently, Node.js server doesn't work as its dependency doesn't support OpenAPI Spec3.
For further details, see https://github.com/OpenAPITools/openapi-generator/issues/34
[main] INFO o.o.codegen.AbstractGenerator - writing file /Users/akihito1/src/github.com/ackintosh/openapi-generator-1/samples/server/petstore/nodejs/controllers/Pet.js
[main] INFO o.o.codegen.AbstractGenerator - writing file /Users/akihito1/src/github.com/ackintosh/openapi-generator-1/samples/server/petstore/nodejs/service/StoreService.js
[main] INFO o.o.codegen.AbstractGenerator - writing file /Users/akihito1/src/github.com/ackintosh/openapi-generator-1/samples/server/petstore/nodejs/controllers/Store.js
[main] INFO o.o.codegen.AbstractGenerator - writing file /Users/akihito1/src/github.com/ackintosh/openapi-generator-1/samples/server/petstore/nodejs/service/UserService.js
...
...
...
cc @emilianobonassi @CodeNinjai @frol @cliffano (TechnicalCommittee)
from openapi-generator.
from openapi-generator.
@philipmarkgreen, yes, this is still an issue as long as it is in state "Open".
I'd like to know which server(s) actually work and are as easy to deploy. I haven't had any luck on the few other types I've tried (e.g. java-inflector)
from openapi-generator.
There are a lot of red herring comments w.r.t. OpenAPI 3.0: This server doesn't work with any version of the API, not even with swagger 2.0.
from openapi-generator.
fwiw, i was able to get the pet store example working in nodejs by copying the initial swagger.yaml file to the generated api/openapi.yaml. i'm not sure what other consequences there might be from this but the example at least responds to api calls.
ie
openapi-generator generate -g nodejs-server -i api.yaml
cp api.yaml api/openapi.yaml
npm start
from openapi-generator.
Again, waiting for implementation of the node.js server. Can this enhancement request be voted on to figure out what to prioritize?
from openapi-generator.
Interested in seeing this node.js server implemented also. 👍
from openapi-generator.
Related Issues (20)
- [BUG][rust-axum] Support for Unsigned Long Values in Integer Maximum Handling
- [BUG] No argument constructor missing HOT 2
- [BUG][PYTHON] AttributeError: module 'open_api_client' has no attribute 'Optional[str]'
- [REQ][java-helidon-server] Helidon generator does not include equals/hashCode
- [REQ] zapier -> response middleware
- [BUG][KOTLIN] Kotlin Okhttp4 can't create client when cookie and header has the same name
- [BUG][PYTHON] should only allow timezone-aware datetime
- [BUG][kotlin-wiremock] 3xx/4xx/... responses generate invalid code
- [BUG] [Java] Cross-path references are not properly considered for Parameters HOT 3
- [BUG] [cpp-qt-client] C++ compiler error "'asJsonObject': is not a member of" when pulling enums into schemas
- [BUG] openapi-generator-maven-plugin v7.7.0 ignores auth configuration parameter
- [BUG] [python-fastapi] doesn't support additionalProperties properly
- [REQ](rust, client) Use a proper Date and DateTime type for deserializing dates
- [BUG] Using external references in OpenAPI spec
- [BUG] Missing import in generated DTO
- [BUG] [Kotlin][kotlin-spring] Multi-level interface inheritance doesn't work
- [BUG] [JAVA] okhttp-gson client codegen ambiguous references for a component schema "Type"
- [BUG][SWIFT] Incorrect Optional Type Handling for 204 No Content Responses in Generated API Client
- Disable type checking (python) HOT 1
- [BUG][JAVA|SPRING] Properties duplicated in inheritance chain HOT 4
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 openapi-generator.