Skip to content
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

classes representing unions that contain structs have faulty generated fromJson/toJson methods #8

Open
barbicels opened this issue Aug 3, 2021 · 0 comments

Comments

@barbicels
Copy link

A few classes have faulty C++/Qt code generation, specifically, those that are unions containing one or more structs: The generated code expects the structs to be rendered in JSON as standalone objects, but the Stone specification (https://github.com/dropbox/stone/blob/main/docs/json_serializer.rst#union) explicitly (though illogically) states that each struct field is rendered individually in the union object alongside its tag. The example that affects my code is UploadWriteFailed (struct) inside UploadError (union) - see https://github.com/dropbox/dropbox-api-spec/blob/main/files.stone lines 767ff.: The path union member is a struct, but that struct's one field (reason) is rendered as its own object alongside ".tag": "path", not encapsulated inside a "path": {...} object as your generated code expects.

See this conversation with a Dropbox employee, who explains it well: https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Documentation-UploadError-marked-as-open-union-is-datatype-with/m-p/467202/highlight/true#M1556

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant