Skip to content

Conversation

@kanterov
Copy link
Collaborator

Changes

Handle deprecated and private annotations in codegen.

  • Deprecated fields are excluded from codegen
  • Private fields are excluded from documentation

There is a trick to transitively mark fields as deprecated (private) because it's normal for JSON schema to only mark fields as deprecated (private) and not put the deprecated (private) annotation into referenced schemas.

Why

With that, we can continuously check that the Python code is consistent with the latest JSON schema.

@kanterov kanterov temporarily deployed to test-trigger-is April 25, 2025 08:33 — with GitHub Actions Inactive
@kanterov kanterov force-pushed the verify-python-codegen branch from 827649e to 37cc417 Compare April 29, 2025 14:09
@kanterov kanterov marked this pull request as ready for review April 29, 2025 14:12
# TODO remove as a follow-up
"jobs.Task": {
"dashboard_task",
"power_bi_task",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's mostly to reduce the diff because these fields were never there

Copy link
Collaborator Author

@kanterov kanterov Apr 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can add them once we merge this PR, or can change this PR

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Separately is fine, keeps this one focused.

The comment didn't suggest diff minimization, hence the question.



@dataclass(kw_only=True)
class Permission:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this gone?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was a leftover because we didn't clean output folder when re-generating, it was never exported

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, thanks.

@kanterov kanterov requested a review from pietern April 29, 2025 14:25
@kanterov kanterov enabled auto-merge April 29, 2025 14:28
@kanterov kanterov temporarily deployed to test-trigger-is April 30, 2025 07:16 — with GitHub Actions Inactive
@kanterov kanterov added this pull request to the merge queue Apr 30, 2025
Merged via the queue into main with commit a9cdc71 Apr 30, 2025
16 checks passed
@kanterov kanterov deleted the verify-python-codegen branch April 30, 2025 07:50
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.

3 participants