Skip to content

Conversation

@1234-ad
Copy link

@1234-ad 1234-ad commented Oct 2, 2025

Description

This PR addresses issue #2722 by adding documentation for the known issue with readOnly fields appearing in code examples where they shouldn't.

Changes

Why this change?

Issue #2722 reports that readOnly fields incorrectly appear in PATCH request examples. While the core issue requires code changes to the example generation library, this documentation:

  1. Acknowledges the problem - Validates user reports and shows awareness
  2. Provides immediate help - Offers actionable workarounds users can implement now
  3. Reduces support burden - Prevents duplicate issue reports
  4. Improves user experience - Users can continue working while waiting for a fix

Benefits

  • Users can immediately resolve their documentation issues using the workarounds
  • Clear examples show exactly how to implement the solutions
  • Reduces frustration for users encountering this common issue
  • Provides a reference point for similar schema-related problems

Workarounds Provided

  1. Manual Examples - Explicitly define examples excluding readOnly fields
  2. Schema Duplication - Create separate read/write schemas for different operations

This is a documentation-only change that provides immediate value while the underlying issue is being investigated.

Addresses issue Redocly#2722 by documenting the readOnly fields problem in 
code examples and providing practical workarounds for users.
@RomanHotsiy
Copy link
Member

I created a proper fix here: Redocly/openapi-sampler#183

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants