When i use the auto generate body on my tests, it also generates values for values that are defined as read-only. Is there a nice way to not have these values in the generated fields? Or is the only way to not only mark them read only but also hide the values in the Data Schema
Hi Reja,
I’ve tested fields marked as “Read Only” in the schema, and they are not generated when clicking “Auto-generate” (see Fig.1 and Fig.2). Could you share your Apidog version and provide more screenshots to help us investigate?
Alternatively, if you want to hide a field in the schema, you can click “Hide” in the request parameters—this will also exclude it from auto-generation (Fig.3).
Version 2.7.22 (2.7.22)
Apidog Europe
i see that there is is difference when the field is required, if you switch off that is will sometime disapears in the generated data
When a field is marked as non-required, does using “Hide” meet your expectation? I tested this with non-required and hidden fields, and they are not generated during auto-generation.
Yes that does, but i it not strange that required and not required give a different result? I would be nicer to not hide al the readonly field in every endpoint. Or is there a reason that require fields work different with auto generate than not required? Look like a bug to me
Yes, the behavior should be consistent between required and non-required fields. We’re currently investigating this issue - thanks for your feedback.