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

Parameters are now a string rather than an object with name property #53

Closed
georgeduckett opened this issue Aug 7, 2019 · 5 comments
Closed

Comments

@georgeduckett
Copy link

According to the APL documentation, parameters now seem to be simple strings, rather than an object with a name property. Could the json serialization for them be updated to reflect this?

@georgeduckett georgeduckett changed the title Parameters Parameters are now a string rather than an object with name property Aug 7, 2019
@stoiveyp
Copy link
Owner

stoiveyp commented Aug 7, 2019

Hi @georgeduckett - the documentation around parameters still says that although you can create parameters this way, it's not recommended:
https://developer.amazon.com/docs/alexa-presentation-language/apl-layout.html#parameters

For convenience, a simple parameter name may be used instead of the parameter object (such as "title" instead of { "name": "title", ... }. This format is not recommended, but it does allow compact layout definition for those cases where no type coercion or default values are required

This is why I've left parameters the way they are currently. I will look at making an implicit conversion to make it easier to deserialize from a simple string though.

@stoiveyp
Copy link
Owner

stoiveyp commented Aug 7, 2019

I've raised the issue with the Alexa team at https://forums.developer.amazon.com/questions/211862/correct-apl-parameter-format.html to get clear confirmation too 👍

@georgeduckett
Copy link
Author

Ahh ok, that makes sense thanks. It is frustrating when things get inconsistent between the APL designer, devices and different areas of the documentation. Thanks for raising the issue with them!

@stoiveyp
Copy link
Owner

stoiveyp commented Aug 7, 2019

Hi @georgeduckett

Further update. I had some downtime this afternoon and I've put the code change in v4.1 https://www.nuget.org/packages/Alexa.NET.APL/4.1.0

What this now does is only output the full expanded parameter object if there's a property other than "name" in use, otherwise it just outputs the name as a string. This is both for layout and command parameters. Should give you the output you need and still allow both formats to be deserialized from JSON.

Hope this helps

@stoiveyp stoiveyp closed this as completed Aug 7, 2019
@georgeduckett
Copy link
Author

Thanks for the incredibly quick turnaround for this and #54! 👍 👍

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

No branches or pull requests

2 participants