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

Initial Implementation of XML Format #448

Merged
merged 13 commits into from
Jan 10, 2023
Merged

Conversation

JemDay
Copy link
Contributor

@JemDay JemDay commented Mar 11, 2022

  • I believe this is "spec compliant - I was wring this at the same time I was writing the spec.
  • We may want to consider a streaming parsing implementation at some point, but I'm not sure that's needed now.
  • Contains +ve and -ve tests along with some round-trip verifications.
  • Implementation is contained and not visible outside the package/module.
  • Comments welcome :-)

Closes #446

@pierDipi pierDipi self-requested a review March 17, 2022 15:33
docs/xml.md Outdated Show resolved Hide resolved
docs/xml.md Outdated Show resolved Hide resolved
formats/xml/pom.xml Outdated Show resolved Hide resolved
docs/xml.md Show resolved Hide resolved
kafka/pom.xml Outdated Show resolved Hide resolved
JemDay and others added 11 commits January 3, 2023 08:51
Signed-off-by: Day, Jeremy(jday) <jday@paypal.com>
Signed-off-by: Jem Day <Jem.Day@cliffhanger.com>
Signed-off-by: Day, Jeremy(jday) <jday@paypal.com>
Signed-off-by: Jem Day <Jem.Day@cliffhanger.com>
Signed-off-by: Day, Jeremy(jday) <jday@paypal.com>
Signed-off-by: Jem Day <Jem.Day@cliffhanger.com>
Signed-off-by: Day, Jeremy(jday) <jday@paypal.com>
Signed-off-by: Jem Day <Jem.Day@cliffhanger.com>
Signed-off-by: Day, Jeremy(jday) <jday@paypal.com>
Signed-off-by: Jem Day <Jem.Day@cliffhanger.com>
Signed-off-by: Day, Jeremy(jday) <jday@paypal.com>
Signed-off-by: Jem Day <Jem.Day@cliffhanger.com>
Signed-off-by: Day, Jeremy(jday) <jday@paypal.com>
Signed-off-by: Jem Day <Jem.Day@cliffhanger.com>
Signed-off-by: Day, Jeremy(jday) <jday@paypal.com>
Signed-off-by: Jem Day <Jem.Day@cliffhanger.com>
Signed-off-by: Day, Jeremy(jday) <jday@paypal.com>
Signed-off-by: Jem Day <Jem.Day@cliffhanger.com>
Signed-off-by: Day, Jeremy(jday) <jday@paypal.com>
Signed-off-by: Jem Day <Jem.Day@cliffhanger.com>
Signed-off-by: Jem Day <Jem.Day@cliffhanger.com>
Signed-off-by: Jem Day <Jem.Day@cliffhanger.com>
Signed-off-by: Jem Day <Jem.Day@cliffhanger.com>

class XMLUtils {

private static final Pattern XML_PATTERN = Pattern.compile("^(application|text)\\/([a-zA-Z]+\\+)?xml(;.*)*$");
private static final Pattern TEXT_PATTERN = Pattern.compile("^application\\/([a-zA-Z]+\\+)?(xml|json)(;.*)*$");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're adding json too because it's a common / well known "text-based format", right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes ... any text/* content-types are caught in the utility function without using the regex (to keep it simpler!).

Copy link
Member

@pierDipi pierDipi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

LGTM

@pierDipi pierDipi merged commit 433ec5b into cloudevents:master Jan 10, 2023
@JemDay JemDay deleted the jd-xml branch January 24, 2023 19:40
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 this pull request may close these issues.

XML Format Support
2 participants