Skip to content
This repository has been archived by the owner on May 23, 2024. It is now read-only.

Support referencing a representation by its label #68

Open
erunion opened this issue May 2, 2017 · 3 comments
Open

Support referencing a representation by its label #68

erunion opened this issue May 2, 2017 · 3 comments
Assignees

Comments

@erunion
Copy link
Owner

erunion commented May 2, 2017

With the new MSON work in #42, the syntax for referencing another representation in a representation data is:

@api-data director (\Mill\Examples\Showtimes\Representations\Person) - Director

This is fine, but it's a bit... wordy. It would be nice if instead of that you could just do:

@api-data director (Person) - Director

Where Person is being pulled from the @api-label annotation atop the \Mill\Examples\Showtimes\Representations\Person class.

The major problem I see with handling this is that this would require that we parse out representations first, so we have that label data in memory for lookups.

@erunion erunion added this to the v2.0 milestone May 2, 2017
@erunion
Copy link
Owner Author

erunion commented May 3, 2017

Might also be worth extending this to all instances where you'd reference a representation (@api-return, @api-throws, and possibly @api-warning (#70).

@erunion erunion removed this from the v2.0 milestone May 10, 2017
@erunion erunion added this to the v3.0 milestone Nov 19, 2017
@erunion
Copy link
Owner Author

erunion commented Nov 19, 2017

Doing this'll also help us to remove our dependency on PHP namespacing. #17

@erunion erunion self-assigned this Nov 19, 2017
@erunion
Copy link
Owner Author

erunion commented Nov 20, 2017

@api-return and @api-throws are getting a new MSON-like syntax with this change:

Old:

@api-return:public {object} \Mill\Examples\Showtimes\Representations\Theater
@api-throws:public {404} \Mill\Examples\Showtimes\Representations\Error If the movie could not be found.
@api-throws:public {404} \Mill\Examples\Showtimes\Representations\CodedError (\Mill\Examples\Showtimes\Representations\CodedError::DISALLOWED) +BUY_TICKETS+ {movie,theater}

New:

@api-return:public (object, Theater)
@api-throws:public (404, Error) If the movie movie could not be found.
@api-throws:public (404, Coded Error, 666, BUY_TICKETS) {movie,theater}

This also means that we'll no longer support any FQDN error codes. Unfortunate, but necessary to move past just supporting PHP.

@erunion erunion removed this from the v3.0 milestone Feb 1, 2018
@erunion erunion added this to the v4.0 milestone Feb 10, 2018
@erunion erunion modified the milestones: v4.0: OAI, v5.0: Language Agnostic Mar 24, 2018
@erunion erunion removed this from the v6.0: Freddy's Revenge milestone May 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant