Skip to content

Feature Request: non-global directives #109

@shawalli

Description

@shawalli

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions