Code Monkey home page Code Monkey logo

Comments (3)

xavdid avatar xavdid commented on May 26, 2024

Hey there!

In this case, it's best to set everything optional in the schema and validate input in your perform function. Something to the effect of:

if (bundle.inputData.address && !bundle.inputData.address.locality) {
  throw new Error('Locality is required when an address is provided')
}

Make sure to add help text describing that restriction.

from zapier-platform.

wking avatar wking commented on May 26, 2024

On Tue, Apr 03, 2018 at 04:01:17AM +0000, David Brownman wrote:

In this case, it's best to …

Right, that's what I'm doing. But:

There's no loss-of-generality with parent-scoped required; folks who want to require child fields just need to set required for both the parent and child. And having platform support for it saves dev time by consolidating the work in the platform libraries vs. repeating it in any number of consumers.

This is obviously not a must-have issue, but I think we can leave this open as a feature request. And if there are public repositories where I can put in work towards supporting this use-case, please point me at them. In the mean time, I think we should document the current scoping in the schema repo.

from zapier-platform.

xavdid avatar xavdid commented on May 26, 2024

That's fair! I believe the generated fields are plugged into our formatic library and presented (though I don't know enough about the minor details of our front end to confirm that). @mjyoung might be able to say for sure.

from zapier-platform.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.