Skip to content

Add readOnly annotations to JSON schema and filter in PyDABs#4415

Draft
shreyas-goenka wants to merge 8 commits intomainfrom
cli-readonly-schema
Draft

Add readOnly annotations to JSON schema and filter in PyDABs#4415
shreyas-goenka wants to merge 8 commits intomainfrom
cli-readonly-schema

Conversation

@shreyas-goenka
Copy link
Contributor

Summary

This PR adds readOnly and doNotSuggest annotations to the JSON schema for fields that are computed at runtime and should not be set by users.

Builds on: #4414

Changes

JSON Schema

  • Add ReadOnly field to the Schema struct (standard JSON schema annotation)
  • Fields with bundle:"readonly" tag are now marked with readOnly: true and doNotSuggest: true
  • Fields marked as OUTPUT_ONLY in OpenAPI spec get readOnly: true and doNotSuggest: true

PyDABs Code Generation

  • Add read_only field to the Property dataclass to parse readOnly from schema
  • Add remove_readonly_fields() function to filter out readonly fields from code generation
  • Readonly fields like create_time, id, lifecycle_state are now excluded from generated Python code

Test plan

  • Unit tests pass for jsonschema package
  • Unit tests pass for schema generation
  • Python codegen tests pass
  • Schema correctly includes readOnly and doNotSuggest for output-only fields

🤖 Generated with Claude Code

@shreyas-goenka shreyas-goenka marked this pull request as draft February 2, 2026 01:00
Base automatically changed from cli-docs-schema to main February 5, 2026 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant