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

Allow nested _value #51

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Allow nested _value #51

wants to merge 1 commit into from

Conversation

chris-rxr
Copy link

@chris-rxr chris-rxr commented Dec 13, 2019

At present, parameters with custom attributes cannot have child parameters. For cases where _attributes and _value exist, if _value is an object it should also recursively iterate it's children.

For context, the following code doesn't work right now, but would after this change.

client.call({
	method: 'createTransaction',
	attributes: {
		xmlns: 'http://tempuri.org/customXmlns',
	},
	params: {
		UserName: 'user',
		Password: 'password',
		Transaction: {
			_attributes: {
				'xmlns:xsi': 'http://www.w3.org/2001/XMLSchema-instance',
				'xmlns:xsd': 'http://www.w3.org/2001/XMLSchema',
				'xmlns': '',
			},
			_value: {
				Purchases: {
					Purchase: {
						Amount: input.amount,
						Date: input.date,
						Notes: input.notes,
						Client: input.client
					},
				},
			},
		},
	},
}

@chris-rxr chris-rxr changed the title Allow nested _.values Allow nested _value Dec 13, 2019
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.

None yet

1 participant