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

Update to API 1.26 and use Swagger instead of Go #172

Open
galvesribeiro opened this issue Feb 12, 2017 · 11 comments
Open

Update to API 1.26 and use Swagger instead of Go #172

galvesribeiro opened this issue Feb 12, 2017 · 11 comments

Comments

@galvesribeiro
Copy link
Member

Since v 1.25 of the API, Docker started to push new versions of the API specification using Swagger https://docs.docker.com/engine/api/v1.26/

To make easier for updates on Docker.DotNet and to not require having Go to run specgen in order to update the contracts, I would suggest to change the code generation to uso AutoRest since it is used to build all Azure SDKs. It is easier, pure .Net and does't require anything else installed.

What do you think @jterry75?

I can work on that codegen change if you guys approve that.

@jterry75
Copy link
Contributor

I would love to but I gave it a shot and it failed in the AutoRest tool before even parsing their spec. They are doing something odd that I havent had time to figure out what yet. If you can get it to work lets do it.

@galvesribeiro
Copy link
Member Author

I may have a look at it tonight. The yml must work... People is using it everywhere... Will keep you posted...

@galvesribeiro
Copy link
Member Author

Ok... @jterry75 now with #171 merged I'll test the generation with swagger. Do you want me PR to master as usual or you prefer create a branch for API 1.26?

@jterry75
Copy link
Contributor

Lets see how much of a breaking change it is :)

@galvesribeiro
Copy link
Member Author

Soon! :)

@galvesribeiro
Copy link
Member Author

@jterry75 have a look at this:

https://gist.github.com/galvesribeiro/6824ebf6c7f2de3123f3a6f5930a1b64

I don't think it is that bad. I used NSwag since AutoRest indeed has problems (see Azure/autorest#1833) which I've already reported and is waiting a reply.

In all case, it is just a simple console app that we can download and run. Both can even be installed with Chocolatey which makes easy the update and are very simple to use. We don't need templates or something extra to make it run.

What do you think? Should I proceed with the replacement? Our public API remain the same. It will eventually has one or other difference in the objects we expose but nothing crucial since the IXXXOperations is what matter for the users.

@galvesribeiro
Copy link
Member Author

@jterry75 ?

@jterry75
Copy link
Contributor

Sorry I havent had a chance to diff these yet to see what exactly has changed that would be breaking. Will do this tomorrow

@galvesribeiro
Copy link
Member Author

@jterry75 indeed there are problems with Autorest and looks like people there doesn't reply to issues... Just a deadland there...

Can you get https://docs.docker.com/engine/api/v1.26/ objects updated? I want to move forward with the other issues...

@jterry75
Copy link
Contributor

jterry75 commented Mar 3, 2017

@galvesribeiro - I think this is a great idea and I will investigate it a little harder but the issue is mainly around how our API detects which properties go in the headers/query/body and this just seems to omit all of that as far as I can tell. In many cases the change would just flat out work but in some I don't have any idea how to do the conversion. I think I would need to re-write most of the *parameters classes to more explicitly pass query properties only as more like a property bag or something and allow you to use these objects purely as the body.

Im also not in love with how they are doing the Anonymous** types but that can be overcome too.

For now lets just finish the v1.25 api and I will figure out how to incorporate this and maybe a bridge API that converts the old ideas into this so that we dont break everyone.

@galvesribeiro
Copy link
Member Author

@jterry75 that is what I'm saying to ignore autorest. Lets just update to 1.26. Thinks changed there. Otherwise we will need a new set of changes to 1.25 and then to 1.26 again.

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

2 participants