Closed njaczko closed 3 years ago
Jira: https://liveramp.atlassian.net/browse/API-415
The feature added by this PR is described here: https://github.com/LiveRamp/reslang/blob/support-http-headers/docs/reference.md#http-request-headers
I'm definitely open to suggestions for better solutions to the problem I described in this comment: https://github.com/LiveRamp/reslang/blob/support-http-headers/src/genswagger.ts#L33-L48 I think the implementaion I went with is pretty simple and adds the fewest conditionals, but it might not be elegant or intuitive :/
Unfortunately, the order in which the addHeaderParams function and the formIdOperations/formNonIdOperations functions are called matters, but they could be implemented in such a way that the order doesn't matter. To do so would require many changes inside formIdOperations and formNonIdOperations which are incredibly complex and have effectively no test coverage. I felt like the risk of introducing bugs and effort of making the changes was not worth it. I documented all this in the code: https://github.com/LiveRamp/reslang/blob/support-http-headers/src/genswagger.ts#L201 https://github.com/LiveRamp/reslang/blob/support-http-headers/src/genswagger.ts#L242
addHeaderParams
formIdOperations
formNonIdOperations
If CJ merges his open PR first I will change the Reslang version bump in this PR accordingly (or we can bundle them into one release)
Will resolve https://github.com/LiveRamp/reslang/issues/159
This change is
Bonus in this PR: updated the grammar so the /events, /operations, and /request-headers sections can be included in any order!
/events
/operations
/request-headers
Jira: https://liveramp.atlassian.net/browse/API-415
The feature added by this PR is described here: https://github.com/LiveRamp/reslang/blob/support-http-headers/docs/reference.md#http-request-headers
I'm definitely open to suggestions for better solutions to the problem I described in this comment: https://github.com/LiveRamp/reslang/blob/support-http-headers/src/genswagger.ts#L33-L48 I think the implementaion I went with is pretty simple and adds the fewest conditionals, but it might not be elegant or intuitive :/
Unfortunately, the order in which the
addHeaderParams
function and theformIdOperations
/formNonIdOperations
functions are called matters, but they could be implemented in such a way that the order doesn't matter. To do so would require many changes insideformIdOperations
andformNonIdOperations
which are incredibly complex and have effectively no test coverage. I felt like the risk of introducing bugs and effort of making the changes was not worth it. I documented all this in the code: https://github.com/LiveRamp/reslang/blob/support-http-headers/src/genswagger.ts#L201 https://github.com/LiveRamp/reslang/blob/support-http-headers/src/genswagger.ts#L242If CJ merges his open PR first I will change the Reslang version bump in this PR accordingly (or we can bundle them into one release)
Will resolve https://github.com/LiveRamp/reslang/issues/159