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

add basic xml support #53

Draft
wants to merge 20 commits into
base: master
from
Draft

add basic xml support #53

wants to merge 20 commits into from

Conversation

@gitu
Copy link
Contributor

@gitu gitu commented Aug 26, 2019

Heya @deepmap-marcinr

I would like to use the generated json fields to serialize to xml what would be needed to get something like that merged. What is in this PR would be sufficient for my purposes.

Cheers

@deepmap-marcinr
Copy link
Contributor

@deepmap-marcinr deepmap-marcinr commented Aug 26, 2019

The XML serialization doesn't have feature parity with JSON, because we have extra model code generated for additionalProperties support for JSON, which is missing for XML. I'm worried about this disparity.

Could you either support additionalProperties adapters for XML, or detect when we have an XML content type and additionalProperties is enabled and return an error that this isn't supported?

@deepmap-marcinr
Copy link
Contributor

@deepmap-marcinr deepmap-marcinr commented Aug 26, 2019

Existing code will already generate correct adapter types where needed, you'd need to extend https://github.com/deepmap/oapi-codegen/blob/master/pkg/codegen/templates/additional-properties.tmpl with XML bindings, or better yet, make a separate template file for the XML version of this.

@gitu gitu force-pushed the gitu:basic-xml-support branch from 9b39a07 to b12114d Nov 13, 2019
gitu added 16 commits Nov 13, 2019
# Conflicts:
#	internal/test/issues/issue-52/issue.gen.go
#	internal/test/server/server.gen.go
#	pkg/codegen/codegen.go
wip
# Conflicts:
#	examples/petstore-expanded/chi/api/petstore.gen.go
#	examples/petstore-expanded/echo/api/petstore-types.gen.go
#	examples/petstore-expanded/petstore-client.gen.go
#	internal/test/parameters/parameters.gen.go
#	internal/test/server/server.gen.go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.