Comments (7)
Thanks for the report! I'll take a look.
from elixir-google-api.
So here's the crux of the issue: Operation
is a shared object across different APIs. Thus, the metadata
and response
fields lack a defined structure in the specification (they include a reference to a structure which is not included in the discovery doc). We'll have to figure out a way to signal that these fields should not be modified - they'll end up just returning the list/map values that Poison
decodes from the json.
from elixir-google-api.
Thanks for looking into it!
From what I've read, having
"type": "object"
with no properties
key is the expected way to handle an unknown nested structure in OpenAPI.
It seems like a possible issue in Swagger Codegen if
"response": {
"additionalProperties": {
"description": "Properties of the object. Contains field @type with type URL.",
"type": "any"
},
"description": "The normal response ...",
"type": "object"
},
Is attempting to find an Object
module when it wasn't given a $ref
to a type, but rather just object
.
We'll have to figure out a way to signal that these fields should not be modified - they'll end up just returning the list/map values that Poison decodes from the json.
Yeah, in my locally linked version of this client, I just removed these lines and everything works great.
from elixir-google-api.
Yes removing those lines would work. Unfortunately it's non-trivial. All of the client libraries are generated code using the swagger-codegen project (with custom templates). Swagger-codegen uses mustache templates which by design has almost not logic in templates. Detection of an empty object type would have to happen upstream in swagger codegen's Java code.
from elixir-google-api.
Same thing happens using when I modify their test schema to use the same pattern.
I think they are detecting empty objects somewhere before they generate the code itself. If I generate Python and Ruby clients with the same schema, they map metadata
to object
and Object
, respectively. Maybe they're intentionally using these classes over dict
and hash
for some reason, and there's just no parallel in Elixir since it's not OO?
One other question: do you where any
in "type": "any"
comes from? I don't see any mentions of it in OpenAPI specs.
from elixir-google-api.
😄 I just realized you wrote some of the code I'm looking at. Nice!
Looks like you were on the right track with your comment in the elixir generator. I think I may have it fixed on swagger-api/swagger-codegen@master...Rsullivan00:rs/elixir-object, but I need to go to bed.
from elixir-google-api.
We just released a new speech client which addresses this issue
from elixir-google-api.
Related Issues (20)
- WigWamWoodys HOT 1
- The task "google_apis.auth" could not be found HOT 3
- elixir-google-api broke with latest gcloud pub/sub emulator 0.7.1
- Speech: support v1p1beta1 HOT 2
- The Hex Docs are not being built HOT 2
- STOP GENERATING THOUSANDS OF MODULES!!! HOT 7
- Recommend configuration of Tesla adapter in README
- Copying Object in GCS
- Retail version does not match the doc HOT 5
- google_api_play_integrity package is not available on hex.pm HOT 1
- Version 0.25.0 of `dfa_reporting` is missing on hex.pm
- Unclear attribute, transaction, for GoogleApi.Firestore.V1.Model.CommitRequest
- Struggle integrating FCM Api with phoenix HOT 1
- Synthesis failed for IDS HOT 33
- Is the new Google Identity's API available in this library? HOT 1
- GoogleCloudMlV1_PredictRequest Mount Wrong URL HOT 1
- Empty API References Page for v0.16.1 release for Google API {Spanner, Notebooks, Manufacturers} HOT 1
- Synthesis failed for Transcoder HOT 10
- is batch uploads supported? HOT 1
- dfareporting v4 has been released HOT 1
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 elixir-google-api.