Autorest: Supporting schema-less swagger files

Created on 3 May 2016  路  6Comments  路  Source: Azure/autorest

If no schema is present in swagger file AutoRest generates operations that do not return result (just Task) even for GET operations. Should we consider returning a string instead with response content received from server?

C#

All 6 comments

Seems like a completely reasonable default.

Would it be more appropriate to return a deserialized object based on content type (application/json would return JObject)?

I think it would. It might definitely break clients that return payload that does not correspond with content type, but I don't think that these scenarios are important. Because at least one's API should comply with swagger file.

This would be very useful for data plane APIs. It would also be useful for the same thing to work for request bodies as well.

Does this contradict the reasons for not implementing #931 / #693 "No, we won't do this because the swagger file doesn't specify it"? Even though it'd be useful, too :-)

Howdy!

In our planning for driving towards a stable '1.0' release, I'm marking this issue as 'deferred' :zzz: and we're going to review it during the post-1.0 planning cycle.

_It's not to say that we're not going to work on it, or that this isn't not important, but at the moment, we're picking and choosing the stuff we must do before 1.0._ :horse_racing: :horse_racing: :horse_racing:

We'll make sure we pick this back up at that point. :tada:

A note for when this issue comes back... For our scenarios, string would be better than JObject (or the equivalent in other languages) because our data plane SDK needs type information from an external source to ensure that the response is deserialized correctly.

For better performance, you could go one step further and just return a Stream. That would be ideal.

Was this page helpful?
0 / 5 - 0 ratings