Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Declarative service integration into bus #1733

Open
tshemsedinov opened this issue May 7, 2022 · 0 comments
Open

Declarative service integration into bus #1733

tshemsedinov opened this issue May 7, 2022 · 0 comments

Comments

@tshemsedinov
Copy link
Member

tshemsedinov commented May 7, 2022

We need declarative way to describe integration

To map remote APIs into local application server namespaces with declarative (metadata) descriptions converting them into local stubs catching all calls and transferring them into HTTP(S), WS(S) or other transport interaction.

Here is an example

Service metadata: application/bus/adderService/.service.js

({
  url: 'https://adderService.com/api/adder',
  token: config.secrets.adderService.token,
});

Method metadata: application/bus/adderService/add.js

({
  parameters: {
    a: 'number',
    b: 'number',
  },

  method: {
    get: '/add',
    form: ['a', 'b'],
  },

  returns: 'number',
});

Call example: application/domain/usageExample/doSomething.js

async () => {
  const result = await bus.adderService.add({ a: 100, b: 200 });
  if (result !== 300) throw new Error('I can not believe that');
};

Do not forget to support

  • Path parameters
  • Query parameters
  • HTTP headers
  • Body serialization
  • Cookies

See also: https://swagger.io/docs/specification/serialization/

@tshemsedinov tshemsedinov changed the title Declarative service integration Declarative service integration into bus May 11, 2022
tshemsedinov added a commit that referenced this issue May 28, 2022
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

No branches or pull requests

1 participant