Description
Many of you may have noticed I haven't been doing a lot of work on this project recently since v3 (Laravel 10) dropped earlier this year. To explain, open source time for me is limited at the moment - I've moved to a job that doesn't use this package plus I've had a lot going on outside of work. The combination means I haven't really been keeping on top of things!
The good news is from the middle of May 2023 I will have more time available to look at the new features that need adding to this package.
I wanted to share here what my priorities are. I.e. what is in-scope for v4. My hit-list of features are as follows:
- Update package to JSON:API v1.1
- Automatic routing with
JsonApiRoute::mount()
, customised via PHP attributes on the schema. - Support the Atomic Operations Extension - Will atomic operations be supported here long-term? #39
- Use
SELECT
statements to retrieve only the fields that are actually needed in responses - Sparse fieldsets are not reflected in SELECT query #146 plus only iterating over sparse fields in resources when sparse fields are being used - Avoid loading attribute mutators when using sparse fieldset #241 - Consume the JSON:API implementation programmatically i.e. without a HTTP request - Is there a way to consume the api's without an actual http request ? #144
- Add resource events - Support model events for the specific model being created/updated etc #87
- Support async processing - Implement Asynchronous Processing #10
- Document how to represent pivot tables as intermediary resources, and add any tooling needed to make it easier to do.
- Make validating resource IDs in query parameters a lot easier - Add rule objects to validate resource IDs in query parameters #237
- Improve authorizers to support policy responses - Support policy responses to allow developers to return custom messages when authorization fails #70
- Support "aggregate attributes" - Problem with countable fields #194
- Remove existing countable implementation, replace with draft extension.
- Use JSON Schema for both spec and schema validation.
It's a long list, so it's possible I might spread this over a few major releases, rather than just doing it all for v4.
It's worth noting that this is a big set of work, and will be breaking. To support Atomic Operations and allow the implementation to be consumed programmatically, I need to decouple the implementation from Laravel's form requests. This will be a big step forward, especially as Atomic Operations is one of the big features lots of us want. But it does mean there will be some refactoring when upgrading an application that uses Laravel JSON:API.
Finally I want to mention OpenAPI documentation. I know a lot of people want this. I do want to add it at some point. However, the above list provides a number of features I need in my production APIs. So for me, they are higher priority - and as the creator of this open source project, the reality is I have to prioritise my time on things that are priorities for my projects.
However, the good news is that if I clear the above list, OpenAPI documentation would most likely be the next highest priority to solve.