httpin icon indicating copy to clipboard operation
httpin copied to clipboard

Feature Request: non-global directives

Open shawalli opened this issue 8 months ago • 0 comments

Summary

I'd like to be able to register directives against an instance and then perform encoding and decoding against that instance.

Reason

I have an API (i.e. "API A") that also calls another API ("API B"). API B provides structs with httpin struct tags via an importable package. API A also provides structs with httpin tags. The structs in API A and API B have different needs and therefore different directives that need to be registered. However, with the current design, all directives are registered against the global namespace.

Proposed Solution

The Core struct seems perfectly set up to do this. Each instance could register a new namespace, or have a way of localizing the registrations inside its own scope.

shawalli avatar Jun 10 '24 18:06 shawalli