Closed hauner closed 4 years ago
maybe use source/target
or in/out
to reuse the same keywords. That doesn't work for the add parameter case. Hmm.
spring boot gateway configuration uses something like this:
predicates:
- Path=/**
or
predicates:
- name: Cookie
args:
name: mycookie
regexp: mycookievalue
considering something like this:
map:
# single wrapper, maybe without the "=>"
single: => <to>
# multi wrapper
multi: => <to>
# result wrapper
result: => <to>
# list of global mappings
types:
# standard type mapping
- type: <from> => <to>
- type: <from2> => <to2>
# list of global parameter mappings
parameters:
# map by parameter name
- name: <name> => <to>
# add parameter
- add: <name> => <to>
# map by content type
responses:
- content: <content> => <to>
=>
.a few examples:
map:
result: org.springframework.http.ResponseEntity
types:
- type: Pageable => org.springframework.data.domain.Pageable
parameters:
- name: pageable => org.springframework.data.domain.Pageable
- add: request => javax.servlet.http.HttpServletRequest
responses:
- content: application/json => org.springframework.data.domain.Page<java.lang.String>
the mapping uses multiple pairs of keywords to define the the different mappings:
This is getting confusing. Looking for a better idea to handle the different cases with less keywords.