[WIP] feat: Add register_decorator
#984
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
2025/02/05
Thought process...
plumb()
, collect the text until a parseble objectWhen parsing is done, post process the mutated object
Update 2025/02/07 From conversation with @thomasp85 We should use
{roxygen2}
to parse the tags. I agree!The important part is plumber needs to call a method that will capture the appropriate information and also opt-in to processor method for the corresponding decorator. (No actual processing needs to happen upon discovery, just prep work.) Then, after all decorators have been found, each processor method will execute on the info object.
Ex:
@param
should register that the verify_route_is_handled call is executed. (This method will verify that a@get
etc. is eventually called.).Ex:
@get
would register the add route to router method. It would use information found from@serializer
,@param
,<PATH>
, etc.The processor methods should take
pr
andprocessed_info
. The processor return value will be ignored.Update 2025/02/18
This code is not meant to be merged. It is a non working POC and meant to start a conversation.