-
Notifications
You must be signed in to change notification settings - Fork 125
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
Generating from GitHub OpenAPI spec fails to accept 3.0.3 version #102
Comments
Ok, maybe this error is not actually coming from the plugin. I realized that there are others errors in the build terminal. Eg:
This was caused by enums that contain an empty value:
, I started to patch them one by one, but it is too much :( Maybe it would be a good idea to run the generator against some "well-known" specs (eg. GitHub, k8s, ...)?! |
@t089 Thanks for trying it out, and for taking the time to file an issue.
As you might imagine, we have run it against OpenAPI documents for many well-known APIs. AFAIK Kubernetes works as-is, as do many other well-known APIs. But, as you've noticed, the Github API has some identifiers in which are problematic. While it can currently support a number of popular APIs already, we are continuing our development in the open as we progress to a 1.0 release, allowing us to prioritise the features according to demand and with community feedback. We're incrementally adding support for various features in the OpenAPI specification. The documentation here expands on the progress: https://swiftpackageindex.com/apple/swift-openapi-generator/0.1.3/documentation/swift-openapi-generator/supported-openapi-features. Relevant to the Github API, we added support for empty identifiers in #59 but we are aware the Github API has additional issues with the use of
Here's a patch against the Github OpenAPI document that might serve as a workaround for you in the meantime, which is based on https://github.com/github/rest-api-description/blob/main/descriptions/ghes-3.3/ghes-3.3.yaml:
|
Thank you so much for the detailed answer and for the patch, really appreciate it! I can confirm that this error was indeed because there was some other plugin in VSCode that validated the schema and was set to OpenApi v3.1 🤦♂️ |
On a brand new Swift package I was trying to generate a client from the GitHub OpenAPI spec:
https://github.com/github/rest-api-description/blob/main/descriptions/api.github.com/api.github.com.yaml
The generation fails with a couple of errors in the YAML that can be easily patched, but one in particular is unexpected.
The YAML states in the beginning:
Yet, the generator outputs the following:
String does not match the pattern of "^3\.1\.\d+(-.+)?$".
By why does it try to match against 3.1.x?
The text was updated successfully, but these errors were encountered: