-
Notifications
You must be signed in to change notification settings - Fork 44
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
Creates api-client generator #8784
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get an error when trying to run the generate-client
command. Do I need to test the command or are there some installation steps not included in the PR - intentionally for now?
Error: Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/openapitools/codegen/OpenAPIGenerator has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:468)
at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:495)
at /home/timolegros/Projects/commonwealth/node_modules/.pnpm/@[email protected]/node_modules/@openapitools/openapi-generator-cli/main.js:2:27569
at ChildProcess.exithandler (node:child_process:430:5)
at ChildProcess.emit (node:events:518:28)
at maybeClose (node:internal/child_process:1105:16)
at Socket.<anonymous> (node:internal/child_process:457:11)
at Socket.emit (node:events:518:28)
at Pipe.<anonymous> (node:net:337:12)
Node.js v20.12.1
ELIFECYCLE Command failed with exit code 1.
I'll work on the documentation later, this is just the first draft so we can see the results and adjust a few things like the tooling, tags, naming conventions, governance, etc. This specific error is telling you that you are either missing a JRE or have an invalid one. In my MacOS I just installed it with homebrew => |
This is the first pass at generating a client proxy using
openapi-generator
Requirements
brew install openjdk
pnpm install
to install modulesHow to generate a new client api
pnpm start
. API spec will be found inhttp://localhost:8080/api/v1/openapi.json
pnpm -F api-client generate-client
Notes
trpc-openapi
withtrpc-swagger
since the original project is dead and this new fork has been regularly mantained/packages/commonwealth/server/api/index.ts
:{group}{methodName}
, so for example, if theuser
group defines one commandupdateUser
, the UserAPI will expose:Let's discuss:
Link to Issue
Closes: #8782
Description of Changes
http://localhost:8080/api/v1/openapi.json
"How We Fixed It"