orval icon indicating copy to clipboard operation
orval copied to clipboard

Objects with properties of type object that uses readonly are required

Open torleifhalseth opened this issue 1 year ago • 0 comments

What are the steps to reproduce this issue?

  1. Create a schema with an object type that has a property that is an object or array of objects that has read-only properties. Example:
 PatchedEnrollment:
      type: object
      properties:
        created:
          type: string
          format: date-time
          readOnly: true
        enrolled_user:
          $ref: "#/components/schemas/EnrollmentUser"

What happens?

The NonReadonly is added to the PatchedEnrollment type in the generated hooks, but the read-only properties defined on EnrollmentUser are still required.

What were you expecting to happen?

I was expecting/hoping all the read-only properties would be ignored.

Any other comments?

Love this package ❤️

What versions are you using?

Package Version: 6.14.3 (latest and greatest)

torleifhalseth avatar Apr 17 '23 08:04 torleifhalseth