GithubHelp home page GithubHelp logo

Comments (4)

steveklabnik avatar steveklabnik commented on May 22, 2024

Is there going to be an official list of methods for defining a common subset of all of the extensions (profiles) as suggestions?

Probably not. I need to re-read the profile RFC, but I think you can only have one?

should there be a place to list common profiles/meta URLs,

Ideally, profiles include the application semantics, so really, there shouldn't be a lot of commonality.

How do we avoid bloat of N metas/profiles in each response?

Anything which is used by a large number of people should become an actual addition to the spec. Think of it as 'pull up method', the refactoring technique.

Is there going to be a suggested best practice for profile URLs to contain a version number in the profile URL?

Nope. In general, media types generally aren't versioned. There's nothing stopping you from including a version somehow if you'd like; for example, you could namespace your profiles to introduce one ("profile":"http://mysite.com/v2/profile").

I think that covers everything. Let me know if I didn't.

from json-api.

garysweaver avatar garysweaver commented on May 22, 2024

should there be a place to list common profiles/meta URLs,

Ideally, profiles include the application semantics, so really, there shouldn't be a lot of commonality.

I don't think usually that Rails apps at least are going to be describing custom profile URLs. If someone integrates with a specific api, be it their own application's api or a specific vendor's, they won't benefit as much from some URL that describes something unless it is solely for identification and version as a sanity check that the think that they integrated with did not change.

I see much more benefit in a URL that either describes a package of functionality like a gem that alters API behavior, or it describes a specific behavior or set of behaviors (like paging using a specific URL scheme).

If it describes a package of behavior it might have a 1:1 relationship between the version of the gem and the URL, i.e. https://api.rubygems.org/restful_json/v5.0.0, such that the restful_json gem would emit that version in its response and the client could look at it and determine whether it was compatible, and if not, it may quit or complain unless it matched/fuzzy matched it. It could even have the api description of part of gemspec and rubygems.org could host the human readable description. (And that wouldn't be Ruby specific- the same could be done for Java, etc.- they'd just need their own.) This seems cool, but I don't think it is as useful, because it isn't describing specific behaviors that the client can use, and is basically not much different than application-specific integration. It also would expose what gems a vendor is using in their API, so could even be a security hole.

If it describes a specific behavior instead, it might look like https://some.standards.org.or.vendor/api/paging. Multiple gems that provide paging functionality through controller api extension (like restful_json and others) could use the same URL. Then the client would know it could just append &page=1 to the URL to get the first page of results. But, if this is done, we should really have some sort of standards organization that is ok'ing different schemes so that they were well-planned and could last longer. I think this should be done to greatly future-proof the spec. Most of the current spec could even be split into different behaviors. This would increase the size of the responses significantly, so perhaps it could be a separate single call to get a list of behaviors of the spec that could be cached in the client.

from json-api.

jokeyrhyme avatar jokeyrhyme commented on May 22, 2024

Seems related to #45

from json-api.

jokeyrhyme avatar jokeyrhyme commented on May 22, 2024

Oops, seems related to #21

from json-api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.