-
-
Notifications
You must be signed in to change notification settings - Fork 387
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
Kudos. And a half-baked idea for an application. #32
Comments
HI @ariutta, I think this is an interesting idea and would be interested to see what would come by exploring it further. Potentially including it as a plug-in for hug? Thanks! ~Timothy |
Yes, a plug-in sounds like the right place for it. I'm a little tied up with other projects right now, so it'll be awhile before I can get to it :( But I'd love to find out whether something along these lines would get traction in the dev community. Any opinions on the best format for the type data? JSON Schema might be easiest to apply for multiple languages, but it's really verbose. Typescript is nicer to work with, but it's geared toward JavaScript, and each language would need a parser for TypeScript type definitions. JavaDoc (JSDoc/PythonDoc/etc.) style documentation comments are another option, although they are intended more for their target languages than for JSON. |
@ariutta I had a quite similar idea, see #34 (not involving TypeScript) I have never developed on third party library, but with the right hints I could implement the thing. I am a Python developer and I have quite good knowledge about REST and HYDRA. |
Hi @Mec-iS, you're right - we're thinking along the same lines. Versions of these ideas seem to be popping up all over. As a matter of fact, check out what the FB GraphQL team just released: a GraphQL IDE explorer with "typeahead query completion, error highlighting, query results". Netflix is using Falcor with Sentinel metadata for API typing and cache invalidation. See also: https://speakerdeck.com/btholt/falcorjs-and-react BreezeJS works with OData for API typing, although the NuGet team actually moved from OData to JSON-LD. GraphQL is moving away from strict REST/Hypermedia patterns more than BreezeJS/OData, which makes it less useful for public APIs and especially for Linked Open Data. Not 100% sure about Falcor for that case. What about one of these options:
BTW, @timothycrosley, do you think this thread belongs here or in its own repo? |
Hi @ariutta I am taking a look to all the options you pointed out; but they all seem to be supported by different actors in the market, without a defined standard to base on. So, talking server-side, I would base the first improvement on HYDRA. After that, the next step could be to leverage the HYDRA feature in h.u.g. to make the server able to respond to as many clients libraries on the market as possible. So, much simpler:
Your point 2. could be nice, but i don't see any advantage to port h.u.g. to Falcor. I think h.u.g. has a good potential as it is (Falcon is a very good web-server): adding support to other W3C standards (maybe also to SPARQL endpoints for LD, using a good triple store) can be a great way to go. See you on the gitter chat for futher exchanges of ideas. Links: |
Closing this issue, because this is probably more of a plugin, which would go in a separate repo. |
Kudos on your work! I'll be watching to see where it goes.
The half-baked idea I'd like to work on sometime (when I get time):
Up till now, hypermedia APIs have not gotten as much as attention as they deserve, arguably because they are designed for a theoretical client that doesn't actually exist. What if this client did exist in the form of code completion and validation engines for multiple languages? By existing only as a helper for the developer, it might avoid the mess of CORBA and SOAP.
Hug could make this easy if it used the HTTP Link Header to return type information. For example, it could return the following for the
/users
API endpoint:With http://www.janedoe.com/typedefs/person.d.ts being something like this (using Typescript to describe JSON because JSON Schema is unwieldy):
And a sample response body for a GET request:
Related:
The text was updated successfully, but these errors were encountered: