-
Notifications
You must be signed in to change notification settings - Fork 507
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
Incomplete field names for nested arrays #1021
Comments
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days |
bump |
I haven't tried to reproduce this, but if you send a PR, the proof should be in the tests. |
We've also experienced this with a different set of parameters: Given a model:
and controller:
and request:
the error would contain paths: children.$0.Id but not the parent index. |
@WoH, here's a failing templateHelpers.spec.ts test describing the defect:
and a second failing test, reveling side effects of the issue:
|
Sorting
I'm submitting a ...
I confirm that I
Expected Behavior
Given a model and controller such as this
and passing it a payload such as
{"item":{"children":[{}]}}
, I would expect a validation error referencing a missing field atpayload.item.$0.children.$0.name
. In fact, the validation error referenceschildren.$0.name
.It looks like the problem is that
parent
is not included in https://github.com/lukeautry/tsoa/blob/master/packages/runtime/src/routeGeneration/templateHelpers.ts#L410 and https://github.com/lukeautry/tsoa/blob/master/packages/runtime/src/routeGeneration/templateHelpers.ts#L413. In both those, I suspect that the call should actually beI'm happy to submit a PR if I'm on the right track with this.
The text was updated successfully, but these errors were encountered: