I'm planning to build a solid API for my clients using Laravel, and I'm starting from scratch. I'm not really into GraphQL, but maybe I'm overlooking something valuable there. Since Laravel defaults to using JSON, I'm trying to understand how to structure my API responses effectively.
I've been reading about API schemas and I'm a bit confused about their importance. For instance, if I were to create a TV API, should I include the schema as a key in my response? I was thinking of linking to an external schema instead, which would outline fields like title, genre, tags, and description.
What's considered standard practice nowadays? I know there's a lot of flexibility in how APIs can be designed, but I'm aiming for some kind of standard to follow. Thanks for any insights!
1 Answer
REST is definitely the standard you’d want to follow for APIs. It's widely used and well understood by most developers. It might be a good idea for you to check out some REST tutorials or courses to get a solid understanding of it. Just a heads up, with REST, you’ll want to clearly define your endpoints and stick to the conventions to ensure they’re intuitive for users.
Any recommendations on specific courses? I’ve used REST in the past, but I’m looking to create something more robust in the future.