Skip to content

fix: per method validations#36

Open
stambata wants to merge 4 commits intomasterfrom
feat/validations
Open

fix: per method validations#36
stambata wants to merge 4 commits intomasterfrom
feat/validations

Conversation

@stambata
Copy link
Member

per method validations

@stambata
Copy link
Member Author

stambata commented Feb 24, 2020

Maybe instead of defining method validations on port configuration level (as implemented in this PR) we can change the bus.registerLocal api to accept structured method definitions instead of plain functions.

E.g. In https://github.com/softwaregroup-bg/ut-bus/blob/master/serviceBus.js#L80

Instead of:

{
    'a.b.c': function() {},
    'x.y.z': function() {}
}

We can add support for registering modules represented with more complex structures like:

{
    'a.b.c': {
        handler: function() {},
        validation: ...
    },
    'x.y.z': {
        handler: function() {},
        validation: ...
    }
}

This way we can we add message validations on method level and leave each module define it's own message formats without needing to import any validations in the http server

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants