Skip to content

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

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.

2 participants