Beapi-io / spring-boot-starter-beapi

Springboot 'convention over config' starter for API Automation
Other
1 stars 1 forks source link

FEATURE: X-LINK-RELATIONS #94

Closed orubel closed 12 months ago

orubel commented 1 year ago

Unlike HATEOAS that AUTOMATICALLY sends back a ton of additional data that you may not want, I wanted to make this optional upon REQUEST.

You can send a HEADER ('X-LINK-REQUEST') for the related links and it wouyld provide a 'concatenated'response:

        "response": {
         ...
        },
        "links": {
            "/accounts/12345/deposit":{
                    "POST",
                   "REQUEST":{"id"},
                   "RESPONSE":{"id","amount","acctNo"}
            }
        }

Naturally like everything else, this would be related to the requesting users ROLES in their token.

This makes us more feature compliant with HATEOS while not being as bloated as HATEOS

orubel commented 1 year ago

passed as "Header X-LINK-RELATIONS=true"

orubel commented 12 months ago

LinkedRelations are built in RequestInitializationFilter at cache and ApiInterceptor at postHandler

We need to create LinkRelationsService to contain all methods and handle hand off of HttpServletRequest

orubel commented 12 months ago

done.Tested. closing.