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

SerializerConfig introduced 2 issues #357

Closed
jforand opened this issue Dec 17, 2020 · 3 comments · Fixed by #358
Closed

SerializerConfig introduced 2 issues #357

jforand opened this issue Dec 17, 2020 · 3 comments · Fixed by #358
Labels
enhancement New feature or request

Comments

@jforand
Copy link

jforand commented Dec 17, 2020

Hello,

1st issue is that the constructor interface for XmlSerializer changed.

XmlSerializer(encoding=None)

no longer works. This is a smaller issue as I can change my code to support the new library (but it's still a change that isn't backwards compatible)

2nd issue is that the XmlWriter no longer supports encoding=None. This is a blocker, as I have a rest API that will not accept a payload with an encoding.

@tefra
Copy link
Owner

tefra commented Dec 17, 2020

Yes, the last version broke the backwards compatibility, I know it's painful but it will be easier from now on to add new options.

The second one was never an intentional feature, more like a side effect for the lxml writer, I will take care of that.

tefra added a commit that referenced this issue Dec 17, 2020
Resolves #357, the introduction of the SerializerConfig
broke the side effect of not being able to omitt xml
declaration only with the lxml writer.

This brings it back for all writers :)
tefra added a commit that referenced this issue Dec 17, 2020
Resolves #357, the introduction of the SerializerConfig
broke the side effect of not being able to omitt xml
declaration only with the lxml writer.

This brings it back for all writers :)
@tefra tefra added the enhancement New feature or request label Dec 17, 2020
tefra added a commit that referenced this issue Dec 17, 2020
Resolves #357, the introduction of the SerializerConfig
broke the side effect of not being able to omitt xml
declaration only with the lxml writer.

This brings it back for all writers :)
@tefra
Copy link
Owner

tefra commented Dec 17, 2020

Thanks for reporting @jforand the new SerializerConfig option is on mater @ a2eb1d2
now it's possible to omit the xml declaration for all writers.

    config = SerializerConfig(xml_declaration=False)
    serializer = XmlSerializer(config=config)

@jforand
Copy link
Author

jforand commented Dec 17, 2020

Perfect, thanks. That solves the issue nicely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants