Comments (7)
@NiteLordz thanks for raising this - I've resolved the deserialization issue in 2.1.0 which is now in NuGet.
There was a secondary issue with the long text example as the library didn't support simple parameters, that's been fixed as well.
Hope this helps.
from alexa.net.apl.
@stoiveyp
Document is now deserializing without the exception, however, I am still having an issue with nested items. It works fine if only one level of items, but if it is nested, then the nested items do not show up.
sample serialized render document directive below
{"document":{"type":"APL","version":"1.0","theme":"dark","import":[{"name":"alexa-layouts","version":"1.0.0"}],"resources":[{"description":"Stock color for the light theme","colors":{"colorTextPrimary":"#151920"}},{"description":"Stock color for the dark theme","when":"${viewport.theme == 'dark'}","colors":{"colorTextPrimary":"#f0f1ef"}},{"description":"Standard font sizes","dimensions":{"textSizeBody":48,"textSizePrimary":27,"textSizeSecondary":23,"textSizeSecondaryHint":25}},{"description":"Common spacing values","dimensions":{"spacingThin":6,"spacingSmall":12,"spacingMedium":24,"spacingLarge":48,"spacingExtraLarge":72}},{"description":"Common margins and padding","dimensions":{"marginTop":40,"marginLeft":60,"marginRight":60,"marginBottom":40}}],"styles":{"textStyleBase":{"description":"Base font description; set color and core font family","values":[{"color":"@colorTextPrimary","fontFamily":"Amazon Ember"}]},"textStyleBase0":{"description":"Thin version of basic font","extend":"textStyleBase","values":{"fontWeight":"100"}},"textStyleBase1":{"description":"Light version of basic font","extend":"textStyleBase","values":{"fontWeight":"300"}},"mixinBody":{"values":{"fontSize":"@textSizeBody"}},"mixinPrimary":{"values":{"fontSize":"@textSizePrimary"}},"mixinSecondary":{"values":{"fontSize":"@textSizeSecondary"}},"textStylePrimary":{"extend":["textStyleBase1","mixinPrimary"]},"textStyleSecondary":{"extend":["textStyleBase0","mixinSecondary"]},"textStyleBody":{"extend":["textStyleBase1","mixinBody"]},"textStyleSecondaryHint":{"values":{"fontFamily":"Bookerly","fontStyle":"italic","fontSize":"@textSizeSecondaryHint","color":"@colorTextPrimary"}}},"layouts":{},"mainTemplate":{"parameters":["payload"],"items":[{"when":"${viewport.shape == 'round'}","type":"Container","direction":"column","items":[{"type":"Image","source":"${payload.bodyTemplate7Data.backgroundImage.sources[0].url}","scale":"best-fill","position":"absolute","width":"100vw","height":"100vh"},{"type":"AlexaHeader","headerTitle":"${payload.bodyTemplate7Data.title}","headerAttributionImage":"${payload.bodyTemplate7Data.logoUrl}"},{"type":"Container","grow":1,"alignItems":"center","justifyContent":"center","items":[{"type":"Image","source":"${payload.bodyTemplate7Data.image.sources[0].url}","scale":"best-fill","width":"100vh","height":"70vw","align":"center"}]}]},{"type":"Container","items":[{"type":"Image","source":"${payload.bodyTemplate7Data.backgroundImage.sources[0].url}","scale":"best-fill","position":"absolute","width":"100vw","height":"100vh"},{"type":"AlexaHeader","headerTitle":"${payload.bodyTemplate7Data.title}","headerAttributionImage":"${payload.bodyTemplate7Data.logoUrl}"},{"type":"Container","direction":"row","paddingLeft":"5vw","paddingRight":"5vw","paddingBottom":"5vh","alignItems":"center","justifyContent":"center","items":[{"type":"Image","height":"75vh","width":"90vw","source":"${payload.bodyTemplate7Data.image.sources[0].url}","scale":"best-fill","align":"center"}]}]}]}},"dataSources":{"bodyTemplate7Data":{"type":"object","objectId":"bt7Sample","title":"Today's Daily Photo of Cheese","backgroundImage":{"contentDescription":null,"smallSourceUrl":null,"largeSourceUrl":null,"sources":[{"url":"https://d2o906d8ln7ui1.cloudfront.net/images/BT7_Background.png","size":"small","widthPixels":0,"heightPixels":0},{"url":"https://d2o906d8ln7ui1.cloudfront.net/images/BT7_Background.png","size":"large","widthPixels":0,"heightPixels":0}]},"image":{"contentDescription":null,"smallSourceUrl":null,"largeSourceUrl":null,"sources":[{"url":"https://d2o906d8ln7ui1.cloudfront.net/images/MollyforBT7.png","size":"small","widthPixels":0,"heightPixels":0},{"url":"https://d2o906d8ln7ui1.cloudfront.net/images/MollyforBT7.png","size":"large","widthPixels":0,"heightPixels":0}]},"logoUrl":"https://d2o906d8ln7ui1.cloudfront.net/images/cheeseskillicon.png","hintText":"Try, "Alexa, search for blue cheese""}}}
from alexa.net.apl.
@NiteLordz This was a great example - thank you. I made the example a test file as a RenderDocumentDirective to deserialize it as a single piece - and with the failed test I was able to publish v3.0.0
Style extensions can be strings or arrays - but were only arrays in the package, so that's fixed.
There was an issue deserializing APLValue when the type was a list (such as component items) and this has been fixed too.
Your hint text had unescaped quotes, so I had to alter that. But other than that and the directive type I had to add, the result matches your input and appears correct.
Hope this helps and you're having a good holiday period.
from alexa.net.apl.
Getting much closer!!! Am now able to deserialize the document elements, however, Data sources do not deserialize.
In the unit tests, "RenderDocument.json" executes properly and has the Data Sources filled in.
However, if you substitute "KeefersExample" in, you will see that the data sources are not populated. Properties element is null.
This is another nested item.
Holiday week has been GREAAT!!! hope yours has been as well!
from alexa.net.apl.
@NiteLordz This one took a little longer as it's a mismatch to the documentation and the documentation still works, so I didn't want to break it.
Documentation says ObjectDataSource should honor a "properties" object for the data, but the designer is adding them dynamically at the top level. Both work - just means the path you use has .properties.
or not.
I've added a TopLevelData property in 3.1.0 (just published) to allow for the designer approach, which means you can access the data in your data source through that. Properties
is still there for any existing ObjectDataSources in use so it's not another breaking change.
from alexa.net.apl.
Confirmed, and databinding is occuring! #Success #CloseThisIssue
Btw, send ya a twitter follow, had some other things wanted to talk to ya about, in a non GH arena lol.
from alexa.net.apl.
Brilliant news, thank you for sticking with it/me!
The designer/doc mismatch has bitten me more than a few times with APL, but it's just such a big thing we can't have missing support in Alexa.NET
I'll make sure you're on my twitter list 👍
from alexa.net.apl.
Related Issues (20)
- Parameters are now a string rather than an object with name property HOT 5
- Events should be an array HOT 3
- Properties that are currently APLAbsoluteDimensionValue prevent using expressions HOT 1
- JSON as APLDocument HOT 9
- Safe Updates to APL Versions with HOT 2
- Container "Data" property cant be data bound
- No ListDataSource HOT 4
- Add opacity to APLcomponent HOT 1
- Filling ListDataSource with Data HOT 1
- How to build "Karaoke Mode" and survive HOT 4
- StyleValue has an empty constructor with a parameter HOT 1
- APLComponent.When has wrong type HOT 2
- Question: How to add APL support in Azure Functions? HOT 2
- Component should implement IEnumerable<IComponent> HOT 2
- Question: How to use APL and data files from Alexa designer? HOT 10
- Setting slot values from UserEventRequest HOT 2
- Improve readme around referencing saved APL Docs HOT 1
- Container item array is serialized as a single item HOT 1
- Alexa headline footer does not work HOT 2
- Data property on Sequence is a List<object> HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from alexa.net.apl.