Skip to content

Mark output-only fields with doNotSuggest#3599

Merged
ilyakuz-db merged 4 commits intomainfrom
json-schema-hide-output-only-fields
Sep 23, 2025
Merged

Mark output-only fields with doNotSuggest#3599
ilyakuz-db merged 4 commits intomainfrom
json-schema-hide-output-only-fields

Conversation

@ilyakuz-db
Copy link
Contributor

Changes

  1. Mark output-only fields with doNotSuggest: true to exclude them from autocompletion
  2. Remove output-only fields from docs

Why

Currently, we suggest all fields in code-completion, but fields marked in the OpenAPI spec as output-only are not used by the CLI

Tests

Added unit test

@eng-dev-ecosystem-bot
Copy link
Collaborator

eng-dev-ecosystem-bot commented Sep 13, 2025

Run: 17919305280

Env ✅​pass 🙈​skip
✅​ aws linux 311 529
✅​ aws windows 312 528
✅​ aws-ucws linux 423 427
✅​ aws-ucws windows 424 426
✅​ azure linux 311 528
✅​ azure windows 312 527
✅​ azure-ucws linux 423 426
✅​ azure-ucws windows 424 425
✅​ gcp linux 310 530
✅​ gcp windows 311 529

- Type
- Description

- - `artifacts_dynamic_version`
Copy link
Contributor

Choose a reason for hiding this comment

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

[optional] it would be easier to review this if catch-up regenerate with unrelated accumulated changes was sent as a separate PR first.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Submitted #3644

If you could approve it, I'll merge it and rebase this PR

"active_deployment": {
"description": "The active deployment of the app. A deployment is considered active when it has been deployed\nto the app compute.",
"$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/apps.AppDeployment"
"$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/apps.AppDeployment",
Copy link
Contributor

Choose a reason for hiding this comment

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

Question -- why not remove this fields from the schema completely?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is probably possible, but it requires more changes in schema traversal helpers. I decided to fix this with a less invasive quick approach just to unblock doc writers

MarkdownExamples string `json:"markdown_examples,omitempty"`
DeprecationMessage string `json:"deprecation_message,omitempty"`
Preview string `json:"x-databricks-preview,omitempty"`
OutputOnly *bool `json:"x-databricks-field-behaviors_output_only,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

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

Question - do we serialize this type ever? or are this annotations just in case?

Why not keep them small, e.g. "output_only"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, example:

"x-databricks-field-behaviors_output_only": |-

Question - do we serialize this type ever? or are this annotations just in case?

Why not keep them small, e.g. "output_only"?

I followed the same approach as with x-databricks-preview to highlight that this field is computed from the OpenAPI spec

@ilyakuz-db ilyakuz-db added this pull request to the merge queue Sep 23, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 23, 2025
@ilyakuz-db ilyakuz-db added this pull request to the merge queue Sep 23, 2025
Merged via the queue into main with commit d2cfdcb Sep 23, 2025
13 checks passed
@ilyakuz-db ilyakuz-db deleted the json-schema-hide-output-only-fields branch September 23, 2025 13:56
github-merge-queue bot pushed a commit that referenced this pull request Nov 5, 2025
## Changes

Instead of marking output-only fields with `doNotSuggest` (see #3599),
completely exclude them from the schema.

This is done by:
- Marking fields as `OUTPUT_ONLY` in `FieldBehaviors` during annotation
- Adding removeOutputOnlyFields transformation to remove these fields
- Also removing them from required lists

This removes 77 output-only properties from the schema.

## Why

Output-only field must not show up in the generated code for Python
support.

## Tests

A few fields were removed from the Python 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.

3 participants