silkapp / rest

Packages for defining APIs, running them, generating client code and documentation.
http://silkapp.github.io/rest
390 stars 52 forks source link

Add support for version-less APIs #142

Closed L8D closed 8 years ago

L8D commented 8 years ago

So this is the path of least resistance to implementing this feature. Hope this helps!

hesselink commented 8 years ago

Just a small note to let you know that I'll review this as soon as possible, it's not forgotten!

L8D commented 8 years ago

bump @hesselink

hesselink commented 8 years ago

Oh, I'm very sorry I forgot about this :(

I've just looked at it, and it looks very good. The only thing I'm a bit unsure about is withVersion. Having it like this means that for unversioned APIs, you'll still need to pass 'latest'. In rest-gen this is the default, so it's no problem. But in the docs handler that means you'll have to have 'latest' in your urls. Is that what you intended? The alternative is for withVersion to take a VersionSet. That way users will have to unpack the API first, and only call it for a versioned API. What do you think?

L8D commented 8 years ago

I think we can leave it with requiring 'latest' for docs. The un-versioned use-case seems to be a small minority and we can deal with whatever inconveniences come with.

hesselink commented 8 years ago

Sounds good. I'll merge and test with our app, and then I'll probably release soon. It's a breaking change, but we have no other breaking changes coming up so there's no use in delaying.

hesselink commented 8 years ago

I've released rest-core 0.39 with this change, and updated the other libraries to support this version.

Thanks!