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

Fixed mailer-id to be common type, so it works with C# client generation #4

Closed
wants to merge 0 commits into from

Conversation

kendallb
Copy link
Contributor

Can't really use oneOf with properties that have the same name, but are not the same type if we expect client generation to work with strongly typed languages like C#.

@kendallb
Copy link
Contributor Author

Also changed package_id to be nullable since it can actually be null in the real responses:

      "packages": [
        {
          "package_id": null,
          "package_code": "fedex_envelope_onerate",
          "name": "FedEx One Rate® Envelope",
          "description": "FedEx® Envelope"
        },

@JamesMessinger
Copy link
Contributor

Hey @kendallb - just wanted to let you know that I'm not ignoring you. Just crazy busy right now. 😰 I'll take a look at this PR as soon as I can.

@kendallb
Copy link
Contributor Author

No worries. As I work through using the API I expect to find more of these so we can wait until I am done and do it all at once.

@vesrah
Copy link

vesrah commented Jun 18, 2021

Thank you, I was able to generate C# with openapi-generator by using your branch.

@kendallb
Copy link
Contributor Author

You may want to just use my pre-generated library?

https://github.com/kendallb/ShipEngineApi

https://www.nuget.org/packages/ShipEngineApi/

It's what we use in production and I maintain it as we run into issues. Some stuff is fixed in there that I don't recall if we found a solution in the schema for.

@kendallb
Copy link
Contributor Author

I am curious though, I use my own modified version of NSwag to generate it, as there are some things that do not generate correctly in C# with the way the API is set up (oneOf stuff) and I hacked NSwag to fix it, but they have not accepted my changes upstream yet. So curious how your generated bindings work for stuff that needs oneOf:

https://github.com/kendallb/NSwag

RicoSuter/NSwag#2991

@vesrah
Copy link

vesrah commented Jun 18, 2021

It seems I spoke too soon, the generation also didn't work properly for me. Unfortunately, your package doesn't have the models, which the project I am working on is already reliant upon.

@kendallb
Copy link
Contributor Author

Which models in particular? I have not worked with an updated schema for a while, so we could integrate the latest schema and generate a new library to see if that includes what you need?

@vesrah
Copy link

vesrah commented Jun 18, 2021

The roundabout explanation of where I am is that we've used the 1.2.30 offical NuGet package for years, which is tied to RestSharp 105.1.0, but we now have other new packages with dependencies on RestSharp 106.3.1. A binding redirect can't be used since there is no publicKeyToken for RestSharp 105.1.0.

It seems that ShipEngine has made a number of changes in the last three years, so I think we're going to end up using your package and updating our integration.

@kendallb
Copy link
Contributor Author

Sounds good, let me know if there are any bits missing or not working I can certainly fix them for you.

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

Successfully merging this pull request may close these issues.

None yet

3 participants