Coder Social home page Coder Social logo

Comments (3)

lbovet avatar lbovet commented on July 23, 2024

I like the backward compatible syntax.
Actually, I would use an enum instead of a boolean:

  • replace: write only if already exists
  • complete: write only if not yet present
  • default: write it in any case
    Please also take care that staticHeaders stuff is also present in hooks.

from gateleen.

lbovet avatar lbovet commented on July 23, 2024

Actually, there is a problem with the union-like typing (either string or object). It prevents to generate code mapping for typed language (e.g. jackson in Java).
It would be better to have another object instead of "staticHeaders".
We could use "headers", since there is a possibility to have more features in the future that will be maybe more dynamic.

from gateleen.

oli-h avatar oli-h commented on July 23, 2024

We have an additional enhancement proposal concerning "staticHeaders": use variables to enable dynamic header values. Example:

"headers": {
  "x-queue": { "value": "my-queue-for-{x-deviceid}", condition: "..." }
}

The syntax {x-deviceid} will be replaced by dynamically from the (assume to exist) value of header x-deviceid.
It would be very fancy if we could also reference query parameters and URL parts as dynamic values.

And not to forget: We have those "staticHeaders" (or new just "headers") no only in static routing (https://github.com/swisspush/gateleen/blob/develop/gateleen-routing/README_routing.md) but also with Hooks (https://github.com/swisspush/gateleen/blob/develop/gateleen-hook/README_hook.md).
We should do it in both modules the same way

Do we need to pay attention for cyclic references?

"aaa": {value: "{bbb}"},
"bbb": {value: "{aaa}"}

from gateleen.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.