Comments (8)
I know we need to be more RESTful. No doubt about that. What's in place now is basically minimum viable product to get people started. All of these comments are great. I'll start a v1.1 API layout that we can all add to. OpenAPI is laid out with YAML if I remember correctly. I think Postman has support for it.
Having a v1.1 that conforms to OpenAPI, and then leaving the current v1.0 active seems like a good balance for those that just want quick hits without full REST, and more robust platform folks.
from docs-api.
@daveajones Is the server-side API code available in another repo?
from docs-api.
I agree that establishing RESTful conventions early on is important - proper use of HTTP verbs is key. I'm a fan of structuring complex queries against OData v4 protocol (v3 support is probably advisable also), rather than having a custom convention for query structure. Many clients will consume OData v4 readily to provide filterable grids, sort, count, pagination, etc. Complex queries can optionally be passed via the HTTP body content as well, as to avoid busting the URI length for GET requests or running into encoding problems.
Make the API self-documenting, featuring an Open API 3.0 (Swagger) metadata endpoint to facilitate automatic client code generation. A web-based, interactive API browser is always a nice touch when trying to attract new developers.
The URI needs to be a short as possible while still being easily legible - for example, "api" is already in the domain, so I believe that could be removed from the stub.
The API version could either an optional query parameter or HTTP header (defaulting to the latest). I imagine the write-end of this API could face some significant breaking changes, especially early on, however, the read-end should strive to be very forward compatible - accessing beta features or pinning code to a specific release becomes a consumer option, but not a requirement.
Combined with making use of pluralization in the semantics, the API can be pretty intuitive:
GET api.podcastindex.org/podcasts
GET api.podcastindex.org/podcast/1/episodes?ver='0.1.0.254-beta'
GET api.podcastindex.org/podcast/3/episode/1
...and to scratch the query itch with something more complex, collections can be handled via OData:
GET api.podcastindex.org/podcasts?$filter=contains(name, 'Some Agenda')&$expand=episodes($filter=lastUpdateTime gt '2020-01-01')
Following on with RESTful conventions, we can really expand into quality of life improvements for developers, like enriching the response body with navigational properties to downstream entity queries - e.g. HATEOAS (Hypermedia as the Engine of Application State) - this could really help simplify client SDK development, because you can recurse through the entity definition even if the link refs have to change later on.
from docs-api.
from docs-api.
@daveajones Is the server-side API code available in another repo?
Not yet. It's a custom framework, so let me figure out the best way to split it up and I'll put something up.
from docs-api.
@daveajones +1 for Open API spec. I've found this tool really helpful for building out OpenAPI specs btw: https://stoplight.io/
from docs-api.
This looks like an interesting tool to use that could take the doctrine code comments and generate the OpenAPI/Swagger json file from our own code documentation: http://zircote.github.io/swagger-php/.
from docs-api.
That is an interesting tool. I need to start testing that. Thank you for passing along.
from docs-api.
Related Issues (20)
- Multiple type issues HOT 1
- document optional properties HOT 1
- Podcasts byFeedId Endpoint bug HOT 4
- How to query episode based upon podcast? HOT 1
- Authenticate-free way of getting a feed and item information by GUID? HOT 2
- Podcasts By Feed ID endpoint `/podcasts/byfeedid` accepts non-numeric ids HOT 4
- Are URLs to podcasting platforms returned from the API? HOT 1
- ByTerm Search "Atari" HOT 5
- Error in schema documentation: newestItemPublishTime HOT 1
- Request: return the podcast GUID in /podcasts/byitunesid HOT 1
- Sorting of `/search/byterm` endpoint
- new endpoint: recent/modifiedfeeds HOT 7
- New Feeds endpoint returns feeds that By Feed ID endpoint does not recognize HOT 3
- Include socialInteract (comments) data on the episodes returned by the API HOT 5
- Pagination in search endpoint HOT 5
- Recent feeds not returning all expected feeds HOT 5
- Order `/episodes/live` by `datePublished` rather than `id` HOT 1
- Wrong schema description and example for /search/byperson HOT 2
- Type inconsistency for the /podcasts/bytag endpoint HOT 4
- Strange issue with /search/byperson HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docs-api.