# Validate Payload node doesn't implement default values?

**URL:** <https://forums.losant.com/t/validate-payload-node-doesnt-implement-default-values/5344>\
**Category:** Feature Request\
**Tags:** workflow\
**Created:** [December 1, 2023, 11:25am UTC](https://forums.losant.com/t/validate-payload-node-doesnt-implement-default-values/5344 "2023-12-01T11:25:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dolf\_Andringa](https://avatars.discourse-cdn.com/v4/letter/d/7c8e57/32.png) [@Dolf\_Andringa](https://forums.losant.com/u/Dolf_Andringa)\
**Post date:** [December 1, 2023, 11:25am UTC](https://forums.losant.com/t/validate-payload-node-doesnt-implement-default-values/5344/1 "2023-12-01T11:25:21Z")

</div>

Hi all, I am using a Validate Payload node to validate the input to a workflow. JSONSchema has a [default](https://opis.io/json-schema/1.x/default-value.html) parameter for properties, to set a default value, but it doesn’t seem this is implemented in Losant. If I require a field, and add a default value, it just fails to validate if the field isn’t present, and if I add a default value but don’t make it required, it the default value doesn’t get added. Is this correct?

---

<div class="post-metadata">

**Author:** ![Brandon\_Cannaday](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/brandon_cannaday/32/14_2.png) [@Brandon\_Cannaday](https://forums.losant.com/u/Brandon_Cannaday)\
**Post date:** [December 1, 2023, 3:06pm UTC](https://forums.losant.com/t/validate-payload-node-doesnt-implement-default-values/5344/2 "2023-12-01T15:06:54Z")

</div>

Hey @Dolf_Andringa,

There’s a couple of things going on, which certainly makes this confusing.

You’ve linked what appears to be a different JSON-schema implementation that treats `default` differently. That implementation says the `default` value is used for validation if no value is present.

The implementation we use treats `default` as an [annotation](https://json-schema.org/understanding-json-schema/reference/annotations) - it’s there to act as an example for non-validation uses of the schema.

In both cases, the `default` value is never added to your data.

---

<div class="post-metadata">

**Author:** ![Dolf\_Andringa](https://avatars.discourse-cdn.com/v4/letter/d/7c8e57/32.png) [@Dolf\_Andringa](https://forums.losant.com/u/Dolf_Andringa)\
**Post date:** [December 2, 2023, 6:23am UTC](https://forums.losant.com/t/validate-payload-node-doesnt-implement-default-values/5344/3 "2023-12-02T06:23:54Z")

</div>

Hi @Brandon_Cannaday  
You are absolutely right. I just checked the official docs [JSON Schema Validation: A Vocabulary for Structural Validation of JSON](https://json-schema.org/draft/2020-12/json-schema-validation#name-a-vocabulary-for-basic-meta)  
and indeed `default` is listed under “Basic Meta-Data Annotations” described as

> These general-purpose annotation keywords provide commonly used information for documentation and user interface display purposes.

Its not intuitive to me in json-schema that you shouldn’t expect the `default` to actually have an effect, but that seems to be what was intended. Just documentation. So your implementation seems to be correct.
