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

Cannot get response deserialization to work with GS1 EPCIS standard open api. #4885

Closed
yvdh opened this issue Jun 24, 2024 · 2 comments
Closed
Labels
Csharp Pull requests that update .net code Status: No Recent Activity status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close type:bug A broken experience

Comments

@yvdh
Copy link

yvdh commented Jun 24, 2024

What are you generating using Kiota, clients or plugins?

API Client/SDK

In what context or format are you using Kiota?

Nuget tool

Client library/SDK language

Csharp

Describe the bug

I am trying to generate an API client for an extensive standardised API, namely GS1 EPCIS (see https://ref.gs1.org/standards/epcis/artefacts for the open api in json format).
I really like the way Kiota create a fluent API for the client (most other API generators create quite messy sets of endpoints).
However, this API relies on the oneOf with schema construct for heterogenuous collections derived from a base class. Although I can perfectly call the API and requests seem to serialize properly as far as I can tell, the responses seem to choke on those heterogenuous collections.

Upon inspection the generator seem to use compositing instead of derivation. As stated in the docs on MSDN, this is by design. However, I can't seem any respons to deserialize with that pattern either (oneOf => allOf with discriminator). Also, it's probably not a good idea to modify an API spec that's standardized anyway ...

More specifically, I have problems with the 'EPCISEvent' collections, and the LDContext.
Ask away if more details needed, I am a bit lost as to where to start ...
Cheers

Expected behavior

Implement oneOf as per OpenAPi spec, not necessarily how it's been (mis)used to implement inheritance in the past.

How to reproduce

Generate client from open spec. Create query to existing server for a set of events (eventTypes/ObjectEvent/events/?MATCH_epc=urn:epc:id:sscc:*). The returned EPCISQueryDocument contains nulls in the LDContext and EventList properties.

Open API description file

https://ref.gs1.org/standards/epcis/openapi.json

Kiota Version

1.15

Latest Kiota version known to work for scenario above?(Not required)

No response

Known Workarounds

No response

Configuration

No response

Debug output

Click to expand log ```
</details>


### Other information

_No response_
@yvdh yvdh added status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience labels Jun 24, 2024
@yvdh yvdh changed the title Cannot get respnse deserialization to work with GS1 EPCIS standard open api. Cannot get response deserialization to work with GS1 EPCIS standard open api. Jun 24, 2024
@msgraph-bot msgraph-bot bot added the Csharp Pull requests that update .net code label Jun 24, 2024
@baywet baywet added status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close and removed status:waiting-for-triage An issue that is yet to be reviewed or assigned labels Jun 25, 2024
@baywet
Copy link
Member

baywet commented Jun 25, 2024

Hi @yvdh
Thanks for using kiota and for reaching out.
Can you provide a sample response please?

I'm guessing that when you refer to the LD context not deserializing properly, you're referring to this schema?

"LDContext": {
                "description": "JSON-LD @context.",
                "anyOf": [
                    {
                        "type": "array",
                        "items": {
                            "anyOf": [
                                {
                                    "type": "string",
                                    "format": "uri"
                                },
                                {
                                    "type": "object"
                                }
                            ]
                        }
                    },
                    {
                        "type": "string",
                        "format": "uri"
                    },
                    {
                        "type": "object"
                    }
                ]
            }

Copy link
Contributor

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Csharp Pull requests that update .net code Status: No Recent Activity status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close type:bug A broken experience
Projects
Archived in project
Development

No branches or pull requests

2 participants