Skip to content

Conversation

@sbernauer
Copy link
Member

@sbernauer sbernauer commented Oct 8, 2025

Fixes kube Schema conversion since schemars Schema's have changed.

  • Add tests for a variety of enum use-cases:
    • Tagged vs Untagged
    • Unit vs Tuple vs Structural variants
    • With and without doc-comments (descriptions)
  • Rewrite the hoisting logic
    • This is annotated with dev-comments to help understand intend and to ease future schemars changes.

This also fixes other issues:

  • Untagged enum variant doc-comments were being applied to field descriptions.
  • Additional null entry added to enums.

@sbernauer sbernauer self-assigned this Oct 8, 2025
@sbernauer sbernauer moved this to Development: In Progress in Stackable Engineering Oct 8, 2025
@sbernauer sbernauer closed this Oct 9, 2025
@sbernauer sbernauer reopened this Oct 9, 2025
Note: As described on the function, it is overly documented to express intent where it can be a little unclear. Ideally where would be some clearer official Kubernetes documentation on the differences between regular OpenAPI 3 schemas, and what Kubernetes accepts.
… there are no oneOfs at the top level of the schema
Note: At this point, there is some strange interaction with the new hoisting functions and the existing code whereby "properties" disappear.
…l as enum

All tests in this PR are passing

Note: The function should be renamed, but it needs some work to not only do optional things.
@NickLarsenNZ

This comment was marked as outdated.

@NickLarsenNZ NickLarsenNZ changed the base branch from main to fix/schema-hoisting October 28, 2025 07:36
@stackable-cla
Copy link

stackable-cla bot commented Oct 28, 2025

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@Techassi Techassi left a comment

Choose a reason for hiding this comment

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

Mostly looks good to me, just a few questions and comments.

@NickLarsenNZ NickLarsenNZ merged commit 6938fad into fix/schema-hoisting Oct 28, 2025
13 of 16 checks passed
@NickLarsenNZ NickLarsenNZ moved this from Development: In Review to Development: Done in Stackable Engineering Oct 28, 2025
sbernauer added a commit that referenced this pull request Oct 29, 2025
Fixes kube Schema conversion since schemars Schema's have changed.

- Add tests for a variety of enum use-cases:
  - Tagged vs Untagged
  - Unit vs Tuple vs Structural variants
  - With and without doc-comments (descriptions)
- Rewrite the hoisting logic
  - This is annotated with dev-comments to help understand intend and to ease future schemars changes.

This also fixes other issues:
- Untagged enum variant doc-comments were being applied to field descriptions.
- Additional `null` entry added to enums.

---------

Co-authored-by: Nick Larsen <nick.larsen@stackable.tech>
Co-authored-by: Sebastian Bernauer <sebastian.bernauer@stackable.tech>
Co-authored-by: Techassi <git@techassi.dev>
NickLarsenNZ added a commit that referenced this pull request Oct 29, 2025
Fixes kube Schema conversion since schemars Schema's have changed.

- Add tests for a variety of enum use-cases:
  - Tagged vs Untagged
  - Unit vs Tuple vs Structural variants
  - With and without doc-comments (descriptions)
- Rewrite the hoisting logic
  - This is annotated with dev-comments to help understand intend and to ease future schemars changes.

This also fixes other issues:
- Untagged enum variant doc-comments were being applied to field descriptions.
- Additional `null` entry added to enums.

---------

Co-authored-by: Nick Larsen <nick.larsen@stackable.tech>
Co-authored-by: Sebastian Bernauer <sebastian.bernauer@stackable.tech>
Co-authored-by: Techassi <git@techassi.dev>
Signed-off-by: Nick Larsen <nick.larsen@stackable.tech>
sbernauer added a commit that referenced this pull request Oct 29, 2025
Fixes kube Schema conversion since schemars Schema's have changed.

- Add tests for a variety of enum use-cases:
  - Tagged vs Untagged
  - Unit vs Tuple vs Structural variants
  - With and without doc-comments (descriptions)
- Rewrite the hoisting logic
  - This is annotated with dev-comments to help understand intend and to ease future schemars changes.

This also fixes other issues:
- Untagged enum variant doc-comments were being applied to field descriptions.
- Additional `null` entry added to enums.

---------

Co-authored-by: Nick Larsen <nick.larsen@stackable.tech>
Co-authored-by: Sebastian Bernauer <sebastian.bernauer@stackable.tech>
Co-authored-by: Techassi <git@techassi.dev>
Signed-off-by: Nick Larsen <nick.larsen@stackable.tech>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Development: Done

Development

Successfully merging this pull request may close these issues.

4 participants