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

feat: parse string wrapped fixed values #155

Merged
merged 1 commit into from
Nov 1, 2021
Merged

feat: parse string wrapped fixed values #155

merged 1 commit into from
Nov 1, 2021

Conversation

dpilch
Copy link
Member

@dpilch dpilch commented Oct 22, 2021

We should wait until after the demo to merge this incase there any last minute bug fixes.

Some props require json, number, or boolean values passed, but Smithy can only pass string.

The current schema says that we can receive boolean, string, and Date types directly, but I believe this is inaccurate. I have kept this functionality for now, but will check with the Studio UI team if this actually possible.

@alharris-at
Copy link
Contributor

It may make sense to instead have a new data type with shape { jsonValue: } so we don't accidentally deserialize a json-ey string that the customer provides us. The only realistic situation I can think of where this would be an issue is if the customer wants to embed json as a string value, and we suddenly marshall it into an object.

@dpilch
Copy link
Member Author

dpilch commented Oct 25, 2021

I had the same thought, but Studio UI team preferred to not change the SDK schema. I'll check with them again.

@dpilch dpilch marked this pull request as draft October 26, 2021 14:33
@dpilch
Copy link
Member Author

dpilch commented Oct 26, 2021

I spoke with Harrison and Scott. They still want to use value and not jsonValue. They suggested that we look at the type of the component prop that the value is being applied to. If the the type is not a string then the value should be parsed.

@dpilch
Copy link
Member Author

dpilch commented Oct 29, 2021

type field has been added to the fixed values schema. This will indicate if a value should be parsed or not.

@dpilch dpilch changed the title feat: parse json Do not merge: feat: parse json Oct 29, 2021
@dpilch dpilch marked this pull request as ready for review October 29, 2021 16:25
@dpilch dpilch changed the title Do not merge: feat: parse json Do not merge: feat: parse parse string wrapped fixed values Oct 29, 2021
@dpilch dpilch changed the title Do not merge: feat: parse parse string wrapped fixed values feat: parse parse string wrapped fixed values Oct 29, 2021
@dpilch dpilch requested a review from alharris-at October 29, 2021 20:41
@dpilch dpilch changed the title feat: parse parse string wrapped fixed values feat: parse string wrapped fixed values Nov 1, 2021
@dpilch dpilch merged commit 3827f7c into main Nov 1, 2021
@dpilch dpilch deleted the parse-json branch November 1, 2021 14:30
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.

2 participants