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

Enhancement : Support for "variable-length" file generation via HTTP API #239

Closed
anujtewari opened this issue Aug 22, 2022 · 2 comments · Fixed by #241
Closed

Enhancement : Support for "variable-length" file generation via HTTP API #239

anujtewari opened this issue Aug 22, 2022 · 2 comments · Fixed by #241

Comments

@anujtewari
Copy link
Contributor

Wire Version: v0.9.0

What were you trying to do?
Generate a "variable-length" file via HTTP API.

What did you expect to see?
Support for "variable-length" file via HTTP API.

What did you see?
No support right now via HTTP API.
As per slack discussion the proposal is expose to a feature to generate "variable-length" file using /files/{fileId}/contents.

One proposal - have a query param type to choose between fixed and variable(can use better names).
Based on this value, appropriate writer can be used. i.e.

for fixed -> use what we have wire.NewWriter(w)
for variable -> use

wire.NewWriter(w, wire.VariableLengthFields(true), wire.NewlineCharacter(""))

** One other thing to take care is how the writer currently handles
{3600}BusinessFunctionCode - TransactionTypeCode. This field is optional as per spec and when not set in payload while creating(/files/create) the file, the decoder still adds the field with "". This happens because a string in Go cannot be nil. Any string field where the JSON key isn't present will end up as an empty string in Go.
This ends up adding * to this tag element for when we request file content i.e CTR* but should be just CTR here.
@atonks2 will investigate and address this after understanding its impact.

@atonks2
Copy link
Contributor

atonks2 commented Aug 22, 2022

Thanks @anujtewari! I'll break the BusinessFunctionCode question into its own issue so we can track these separately.

@atonks2
Copy link
Contributor

atonks2 commented Aug 22, 2022

Extracted the BusinessFunctionCode question to #240

atonks2 added a commit that referenced this issue Sep 1, 2022
feat: [#239] Support for "variable-length" file generation via HTTP API
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

Successfully merging a pull request may close this issue.

2 participants