Closed mpkorstanje closed 4 years ago
Is this stil relevant now that cucumber/common#947 has landed on master?
Looking at react/javascript/src/components/gherkin/Attachment.tsx
there is still a coupling between the encoding and the media type. There shouldn't be one.
What kind of coupling @mpkorstanje? Do you have an example of content encoding and media type that would cause a problem?
Currently:
text/plain
encoded as BASE64
wouldn't be rendered. application/json
encoded as either BASE64
or IDENTITY
wouldn't be rendered.I would expect every embedding to use BASE64
and depending on the media type be decoded by cucumber react. The event producer shouldn't have to parse the media type to know how to encode it. Currently it has to.
For an example of supported embeddings in the wild:
image/*
text/*
application/json
image/url
video/mp4
image/*
text/*
application/json
application/xml
Currently the Java implementation has two issues with the CCK.
When provided with the
mediaType
text/plain
the reference implementation will embed the contents as text. This seems rather unnecessary as there is a dedicated log method to do this. Changing the reference implementation to embed always write attachments as binary would simplify both the reference implementation and Cucumber-JVM.Cucumber-JVM supports file names in attachments. The reference implementation currently does not.