-
Notifications
You must be signed in to change notification settings - Fork 12
[Major] Require samples for all operations #32
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything looks good, just need to revert the manual version change. @eliangcs on monday you can merge this and major. We can also do it on (our) tuesday if we need to check anything else.
package.json
Outdated
@@ -1,6 +1,6 @@ | |||
{ | |||
"name": "zapier-platform-schema", | |||
"version": "4.3.2", | |||
"version": "5.0.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't change this manually, we set it during the deploy process.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Good to merge once we revoke the version bump in package.json
.
443a726
to
df89847
Compare
@xavdid went ahead and dropped that commit (-f pushed to this branch). Thanks! |
A user from the zapier-platform slack brought up an issue with these changes. To be brief, the user pointed out that with the changes to |
Since upgrading to 5.0.0, I reverted back and was able to push live. I think it may have to do with the |
@b4Beta Can you run |
It was not different apart from the more verbose output
|
weird. can you build verbose? It seems like the error is happening and mistakenly being called a validation error |
The line in that file is:
I added I'm not sure they are correct:
As this is a resource it follows the format of:
Should sample be added to each |
Very strange. I'm going to file a separate issue and tag you and we can go from there. |
I updated my comment with more details. |
Ah! This is less mysterious than I thought. Definitely a bug though. The short answer is yes, each of those needs a sample. The good news is that you can put a single sample at the top of the file and use it in each of the |
Mmmm...That is quite a bit of work and not the documented way Shows |
Ah, sorry about that. It's a recent change and we're still in the process of updating documentation. If you've already written the sample, it should be an easy fix! Instead of module.exports = {
key: 'recipe',
noun: 'Recipe',
get: {
display: {
label: 'Get Recipe',
description: 'Gets a recipe.',
},
operation: {
inputFields: [
{ key: 'id', required: true },
],
perform: () => { },
},
},
sample: {
id: 1,
createdAt: 1472069465,
name: 'Best Spagetti Ever',
authorId: 1,
directions: '1. Boil Noodles\n2.Serve with sauce',
style: 'italian',
},
outputFields: [
{ key: 'id', label: 'ID' },
{ key: 'createdAt', label: 'Created At' },
{ key: 'name', label: 'Name' },
{ key: 'directions', label: 'Directions' },
{ key: 'authorId', label: 'Author ID' },
{ key: 'style', label: 'Style' },
]
}; change it to const sample = {
id: 1,
createdAt: 1472069465,
name: 'Best Spagetti Ever',
authorId: 1,
directions: '1. Boil Noodles\n2.Serve with sauce',
style: 'italian',
}
module.exports = {
key: 'recipe',
noun: 'Recipe',
get: {
display: {
label: 'Get Recipe',
description: 'Gets a recipe.',
},
operation: {
inputFields: [
{ key: 'id', required: true },
],
perform: () => { },
sample: sample // ADD THIS LINE
},
},
sample: sample, // now uses the variable
outputFields: [
{ key: 'id', label: 'ID' },
{ key: 'createdAt', label: 'Created At' },
{ key: 'name', label: 'Name' },
{ key: 'directions', label: 'Directions' },
{ key: 'authorId', label: 'Author ID' },
{ key: 'style', label: 'Style' },
]
}; If you don't want to do this, you're also free to continue using v4 for now. This is totally a pain point though, so we'll see what we can do about that. |
Just to let you know that the |
@b4Beta It's on my list to fix this week! In the meantime, do you mind popping over to zapier/zapier-platform-cli#250 and posting a code example to help me reproduce the issue where |
This will require a bump in major. We will now require samples from all (trigger, creates, and search) operations.
We'll need to coordinate the release to NPM, and other repos.