question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Nested schema properties key shared in form object

See original GitHub issue

Plunker

Example

When using a schema with nested properties, where the nested property shares the same name as another nested property (see the ‘raw’ property in the example), the form object (as logged to the console in the example) seems to only contain a single property, for the final nested property with that name. It appears the form control property is being overwritten with each occurrence of one with that name.

I would expect the form object to contain a property for each parent schema property with the nested property as a child, in the example:

{
  [...form validity etc...]
  year: {
    raw: [...form element validity etc...]
  },
  month: {
    raw: [...form element validity etc...]
  }
}

instead, I see:

{
  [...form validity etc...]
  raw: [...form element validity etc...]
}

This is causing me problems because I am unable to access the discrete validity etc. of each form control.

I’m sure I must be misunderstanding how ASF works in this regard. If anyone is able to shed any light on this, I’d be very grateful 😃

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
kysecommented, May 31, 2016

I’ll probably tackle this soon, I’m experiencing the same issues with my getterSetter builder reusing the same object property for an array. I’ve also been meaning to update those templates to wrap inputs in div’s with an ng-class so one can easily set input widths via col-xs-# when using form-horizontal.

0reactions
Anthropiccommented, Apr 18, 2017

This should be working now in the alphas, please re-open if there’s still issues.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Nested object with additionalProperties not working ... - GitHub
Having a nested object with additionalProperties is not working properly, clicking on the "+" button to add a new key/value does nothing. Steps ......
Read more >
Objects - JSON Schema
Properties. The property keyword is used to specify the key:value pairs of JSON documents. The value of property is itself a key:value pair,...
Read more >
How to get nested keys for typescript object and array of objects
For a form generator I am trying to get typesafety for a nested object and array of objects. I would like for the...
Read more >
Structuring a complex schema — Understanding JSON ...
A JSON Pointer describes a slash-separated path to traverse the keys in the objects in the document. Therefore, /properties/street_address means:.
Read more >
JSON Schema validation (nested objects, arrays) in Postman
In this tutorial, we will look at more advanced things regarding JSON schema validation: for example ( nested objects, arrays…).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found