fix OpenAPI definition (and thus making all language-specific SDKs obsolete) #94
Replies: 12 comments 22 replies
-
anyway, going to start on this when i have the time; probably start with fixing the sheet endpoints (since those are the ones i use most) and then expand it to the other public endpoints as time/energy allows. not sure if there exists a public announcement mechanism for up and coming changes to the API but, gee wiz, wouldn't that be something an enterprise-level company like Smartsheet should provide? |
Beta Was this translation helpful? Give feedback.
-
under way - https://github.com/ronreynolds/smartsheet-openapi
|
Beta Was this translation helpful? Give feedback.
-
Hey sorry, just seeing this now. So there were a few key challenges I ran in to while attempting to make the swagger generator work on the open api spec:
There were a number of other issues related to the parser itself, however I think a full rewrite will correct these. |
Beta Was this translation helpful? Give feedback.
-
currently dealing with query-string parameters (all of which are, so far, primitives). not sure one can have multiple schema |
Beta Was this translation helpful? Give feedback.
-
been building a draw.io model of the Etsy OpenAPI spec (for my other work) and have finally circled back to Smartsheet's OpenAPI spec; creating a model for this API would be insane because complex types are defined WITHIN the endpoint definitions (which are then referenced by other endpoint definitions). no wonder the parser can't handle it. i also noticed that the ID types (which are longs by nature) are specified as type "number" so need to update all of those. |
Beta Was this translation helpful? Give feedback.
-
FYI (for those who are interested in OpenAPI specs) there is literally NO difference (according to the generated code) between this:
and this:
|
Beta Was this translation helpful? Give feedback.
-
i noticed
in the parameters of the listEvents endpoint (GET /events) but i don't see it in the
guessing this is a case where the API has gotten ahead of the SDK? |
Beta Was this translation helpful? Give feedback.
-
@DonoA i think i'm starting to find some of the issues you mentioned above; for instance requests like this: "requestBody": {
"content": {
"application/json": {
"schema": {
"oneOf": [
{
"$ref": "#/components/schemas/GroupMember"
},
{
"type": "array",
"items": {
"$ref": "#/components/schemas/GroupMember"
}
}
]
}
}
} current generate Java code that can't compile; e.g., if (List<GroupMember>.class.equals(Integer.class) || List<GroupMember>.class.equals(Long.class) || List<GroupMember>.class.equals(Float.class) || List<GroupMember>.class.equals(Double.class) || List<GroupMember>.class.equals(Boolean.class) || List<GroupMember>.class.equals(String.class)) { wondering if it's possible to coerce the generator to use actual types rather than |
Beta Was this translation helpful? Give feedback.
-
Hey @ronreynolds, I remember that I was going to do some work on figuring out how to replace a lot of the code in our repo with Retrofit. I don't remember who it was, but someone commented on how we have given users of our SDK the ability to pass in their own HTTP clients and how we don't necessarily want to remove that feature. I'm curious on your thoughts about this and how we'd be able to get some of this functionality still with the OpenAPI generated code |
Beta Was this translation helpful? Give feedback.
-
@ronreynolds , would having an additional set of hands be helpful with this project? When I was investigating this it was mostly squashing bugs one at a time. |
Beta Was this translation helpful? Give feedback.
-
@DonoA @apederson94 |
Beta Was this translation helpful? Give feedback.
-
invited you all to my openapi project; also here's an MR for your consideration - ronreynolds/smartsheet-openapi#5 |
Beta Was this translation helpful? Give feedback.
-
been working with a few APIs built from OpenAPI definition files which provide an extreme level of flexibility (language, frameworks, underlying HTTP transport lib, etc) and wondering what's the point of maintaining a language-specific SDK when one can be generated using a build plugin like
org.openapi.generator
? the "only" requirement is that we fix the OpenAPI definition file at https://smartsheet.redoc.ly/. unfortunately last i checked that file was totally borked and i know this is a huge task but imagine the benefits if we could actually get it to work!Beta Was this translation helpful? Give feedback.
All reactions