Skip to content

Conversation

@wintonzheng
Copy link
Contributor

@wintonzheng wintonzheng commented Nov 23, 2025

Update API specifications by running fern api update.


🔄 This PR updates API specifications by running the fern api update command to synchronize the project's API definitions with the latest schema changes. The update ensures that the API documentation and generated code remain consistent with current specifications.

🔍 Detailed Analysis

Key Changes

  • API Specification Update: Automated update of API specifications using Fern's tooling
  • Schema Synchronization: Ensures API definitions are aligned with the latest schema requirements
  • Documentation Refresh: Updates generated API documentation to reflect current specifications

Technical Implementation

flowchart TD
    A[Fern API Update Command] --> B[Schema Validation]
    B --> C[Specification Files Updated]
    C --> D[Generated Code Refresh]
    D --> E[Documentation Sync]
    E --> F[API Consistency Maintained]
Loading

Impact

  • API Consistency: Maintains alignment between API specifications and implementation
  • Documentation Accuracy: Ensures API documentation reflects the most current schema
  • Developer Experience: Provides up-to-date API definitions for client generation and integration

Created with Palmier


Important

Update skyvern_openapi.json to enhance API with conditional logic and improved property documentation.

  • API Specification Updates:
    • Add next_block_label property to multiple block definitions in skyvern_openapi.json for DAG construction.
    • Add descriptions to label properties to specify uniqueness within workflows.
    • Introduce ConditionalBlock, BranchCondition, and BranchCriteria components for conditional logic.
  • Misc:
    • Add version property to WorkflowDefinition and WorkflowDefinitionYAML with default value 1.

This description was created by Ellipsis for 3071f5d. You can customize this summary. It will automatically update as commits are pushed.

Summary by CodeRabbit

  • New Features
    • Conditional blocks with branching logic for dynamic workflow routing based on specified criteria
    • New action type for locating UI elements using natural language prompts
    • Workflow definition versioning support to track configuration changes
    • Improved field descriptions across workflow schema definitions for greater clarity

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 23, 2025

Walkthrough

The OpenAPI schema is updated to support conditional block structures for workflow branching, introducing BranchCondition, BranchCriteria, and ConditionalBlock schemas. Additionally, a LocateElementAction is added for element location capabilities, versioning is introduced to workflow definitions, and descriptive metadata is expanded across multiple block schemas.

Changes

Cohort / File(s) Summary
Conditional Block Constructs
fern/openapi/skyvern_openapi.json
Added BranchCondition (ordered branch edge with order, next_block_label, description, is_default), BranchCriteria (abstract criteria descriptor), ConditionalBlock (new block type with branches array and control fields), and ConditionalBlockYAML variant; integrated into workflow and for-loop block discriminators
Block Type Enum and Discriminators
fern/openapi/skyvern_openapi.json
Added "conditional" to BlockType enum; updated discriminator mappings in WorkflowDefinition, WorkflowDefinitionYAML, and ForLoopBlock to include ConditionalBlock references
Action and SDK Capabilities
fern/openapi/skyvern_openapi.json
Added LocateElementAction schema for UI element location via prompt; integrated into RunSdkActionRequest action union and discriminator mapping
Workflow Versioning
fern/openapi/skyvern_openapi.json
Added version field (integer, default 1) to WorkflowDefinition and WorkflowDefinitionYAML to support workflow definition versioning
Schema Enhancements
fern/openapi/skyvern_openapi.json
Augmented multiple public block schemas (CodeBlock, ExtractionBlock, FileDownloadBlock, FileParserBlock, HttpRequestBlock, LoginBlock, NavigationBlock, TaskBlock, TextPromptBlock, WaitBlock, etc.) with descriptive metadata for label and next_block_label fields across JSON and YAML representations

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Areas requiring extra attention:

  • Discriminator mappings for ConditionalBlock across WorkflowDefinition, WorkflowDefinitionYAML, and ForLoopBlock to ensure consistency and prevent serialization/deserialization issues
  • Schema references and union type definitions for the new conditional branching constructs
  • Integration of LocateElementAction into RunSdkActionRequest and verification of field requirements and constraints
  • Verification that the version field default value (1) aligns with versioning strategy and backward compatibility expectations

Possibly related PRs

Suggested labels

sync, wintonzheng

Suggested reviewers

  • suchintan

Poem

🐰 A branching tale of conditions set,
Where workflows branch with each discrete step,
BranchCriteria guides the way,
ConditionalBlocks in grand display,
Versioned workflows—no more regret!

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title is vague and generic, using non-descriptive phrasing 'fern api update' that doesn't convey meaningful information about the actual changes to the OpenAPI specification. Replace with a more descriptive title that summarizes the main changes, such as 'Add conditional blocks and LocateElementAction to workflow API' or similar.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch update-openapi-spec-2025-11-23T00-36-51-601Z

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Important

Looks good to me! 👍

Reviewed everything up to 3071f5d in 2 minutes and 25 seconds. Click for details.
  • Reviewed 1199 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 6 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. fern/openapi/skyvern_openapi.json:3800
  • Draft comment:
    Consider using OpenAPI’s 'nullable: true' (if supported) instead of the anyOf with null for next_block_label.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 20% vs. threshold = 50% This comment is about code style/structure rather than correctness. Both anyOf with null and nullable: true are valid OpenAPI patterns for representing optional nullable fields. The comment says "Consider using" which is a soft suggestion, not pointing out a bug or issue. The diff shows this pattern is used consistently throughout the entire file for next_block_label across all block types. Changing this would require a large refactor with no functional benefit. The comment also hedges with "if supported" which suggests uncertainty. This appears to be a stylistic preference rather than a necessary change. According to the rules, I should not keep comments that are purely about code quality unless they are actionable and clear - this is more of a "nice to have" suggestion about an alternative approach. The comment could be valid if nullable: true is indeed the preferred or more standard approach in OpenAPI specs. It's possible that the current pattern is more verbose than necessary, and the suggestion could improve readability and maintainability. The consistency argument cuts both ways - if it's wrong, it's consistently wrong throughout. While both approaches are technically valid, this is a stylistic preference without clear evidence that one is superior to the other. The comment uses "Consider" language and includes "if supported" which shows uncertainty. This is not pointing out a bug or clear issue. The rules state not to make comments that are purely stylistic unless they are clearly actionable - this falls into the category of a suggestion rather than a required change. Additionally, this would require changing the pattern across the entire file, which is a large refactor for minimal benefit. This comment should be deleted. It's a stylistic suggestion about an alternative OpenAPI pattern rather than identifying a bug or clear issue. Both approaches are valid, and the comment doesn't provide strong evidence that a change is necessary.
2. fern/openapi/skyvern_openapi.json:4090
  • Draft comment:
    The description references [[s-4bnl]]. Ensure this placeholder is documented or updated for clarity.
  • Reason this comment was not posted:
    Confidence changes required: 50% <= threshold 50% None
3. fern/openapi/skyvern_openapi.json:9578
  • Draft comment:
    LocateElementAction has been reintroduced later in the file. Verify that downstream references and client generators are updated accordingly.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% This comment is asking the PR author to verify downstream references and client generators, which is against the rules. It doesn't provide a specific suggestion or point out a specific issue with the code.
4. fern/openapi/skyvern_openapi.json:15536
  • Draft comment:
    A new 'version' field was added in WorkflowDefinition. Consider adding a description to clarify its purpose and lifecycle.
  • Reason this comment was not posted:
    Confidence changes required: 50% <= threshold 50% None
5. fern/openapi/skyvern_openapi.json:5793
  • Draft comment:
    For ConditionalBlock, consider specifying a minimum number of items for 'branches' if at least one branch is always required.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 20% vs. threshold = 50% This comment is suggesting a schema improvement for the newly added ConditionalBlock. However, this falls into a gray area: 1) It's about new code being added (the ConditionalBlock is new), 2) It's phrased as "consider" which makes it sound optional/speculative rather than pointing out a definite issue, 3) It's a code quality suggestion about validation constraints, 4) Without seeing the actual implementation or requirements, I can't determine if branches should always have at least one item or if zero branches is valid. The comment uses "consider" and "if at least one branch is always required" which shows uncertainty - this is speculative. The comment could be valid if having zero branches in a ConditionalBlock is logically invalid - a conditional block without branches wouldn't make sense. This might be catching a real schema design issue rather than being purely speculative. While the logic makes sense, the comment is phrased speculatively ("consider", "if...required") rather than definitively stating there's a problem. According to the rules, speculative comments should be removed. The comment doesn't provide strong evidence that this is definitely wrong - it's a suggestion for improvement. If this were a critical issue, it would be caught at runtime or in validation. This comment should be deleted. It's phrased as a speculative suggestion ("consider...if") rather than identifying a definite issue. It's asking the author to consider adding validation constraints without clear evidence that the current implementation is wrong.
6. fern/openapi/skyvern_openapi.json:7119
  • Draft comment:
    Consider standardizing the 'next_block_label' description across schemas for consistency.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50% None

Workflow ID: wflow_YWLj63MiXtoyHHzp

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (5)
fern/openapi/skyvern_openapi.json (5)

486-488: Curl examples send YAML as text/plain to JSON-only endpoints.

Spec declares application/json for POST /v1/workflows and POST /v1/workflows/{workflow_id}, but curl samples use Content-Type: text/plain with raw YAML bodies. This will not validate against the OpenAPI contract and misleads users.

Suggested fix (either option):

  • Update examples to send application/json with a WorkflowRequest wrapper (e.g., {"yaml_definition": ""} or {"json_definition": {...}}), or
  • Extend requestBody content to also accept text/plain (string) and document raw-YAML payload semantics.

Also applies to: 764-766


490-496: JSON examples include unsupported field parameter_keys.

In multiple Python/TS examples, blocks under json_definition include parameter_keys, which is not present in JSON block schemas (use parameters array instead). These samples won’t validate.

Action: Replace parameter_keys with parameters (or drop it) in JSON examples; keep parameter_keys only in corresponding YAML block examples.

Also applies to: 768-774, 215-221


15537-15708: YAML parity missing for ConditionalBlock.

BlockType includes "conditional" and JSON WorkflowDefinition/ForLoopBlock support ConditionalBlock, but WorkflowDefinitionYAML and ForLoopBlockYAML do not include ConditionalBlockYAML in their unions/discriminators. No ConditionalBlockYAML schema is defined.

Action: Add ConditionalBlockYAML schema and include "conditional" in WorkflowDefinitionYAML.blocks and ForLoopBlockYAML.loop_blocks discriminator mappings to maintain JSON/YAML feature parity.

Also applies to: 15710-15872, 8521-8586


15069-15121: WaitBlockYAML doesn’t require wait_sec (JSON does).

JSON WaitBlock requires wait_sec; YAML variant lists wait_sec with a default but not required. This mismatch can produce YAML that the server rejects after conversion.

Suggested change: add wait_sec to WaitBlockYAML.required and align defaults.


2816-2819: Python example syntax error (extra comma/parenthesis).

The login Python sample has a trailing comma and unmatched parenthesis, causing a SyntaxError on copy/paste.

Fix: remove the stray comma and extra “)”.

🧹 Nitpick comments (2)
fern/openapi/skyvern_openapi.json (2)

6056-6069: ProxyLocation options: enum vs description mismatch.

Description lists fewer geo options than the enum (e.g., enum includes RESIDENTIAL_BR/TR/CA/MX/IT/NL, description omits these).

Sync prose lists with enum or link to a single authoritative list to avoid drift.

Also applies to: 11320-11349


9579-9597: Action type naming inconsistency.

New LocateElementAction uses type "locate_element" while other AI-driven actions use "ai_*" prefixes (ai_click, ai_input_text, etc.). Minor style inconsistency that can confuse SDK users.

Consider renaming to ai_locate_element or document why it differs.

Also applies to: 11424-11440

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7729d7c and 3071f5d.

📒 Files selected for processing (1)
  • fern/openapi/skyvern_openapi.json (51 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Run tests and pre-commit hooks
🔇 Additional comments (2)
fern/openapi/skyvern_openapi.json (2)

3800-3814: Author-facing label/next_block_label docs: good addition.

The added titles/descriptions for label and next_block_label improve author UX and clarify DAG semantics.

Also applies to: 5610-5623, 6451-6464, 6650-6663, 7065-7078, 7660-7672, 7825-7838, 8638-8651, 8920-8934, 9603-9616, 10339-10352, 11156-11169, 12190-12203, 13251-13264, 13459-13472, 14026-14040, 14156-14169, 14522-14535, 14921-14934


11362-11451: RunSdkAction union updated cleanly with LocateElementAction.

Discriminator mapping and required fields look consistent; response remains generic, which is acceptable.

If specific result shapes are expected for locate_element (e.g., selector/xpath), consider documenting possible result structure in RunSdkActionResponse.

Comment on lines 4098 to 4113
"type": "string",
"title": "Label"
"title": "Label",
"description": "Author-facing identifier; must be unique per workflow."
},
"next_block_label": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Next Block Label",
"description": "Optional pointer to the label of the next block. When omitted, it will default to sequential order. See [[s-4bnl]]."
},
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Leaked placeholder reference in descriptions ("See [[s-4bnl]]").

Several YAML block schemas’ next_block_label descriptions reference an internal anchor [[s-4bnl]], which is broken in public docs.

Action: Remove or replace with a valid public reference.

Also applies to: 5736-5750, 6519-6533, 6942-6956, 7363-7377, 7743-7757, 7980-7994, 8812-8825, 9264-9277, 9902-9915, 10631-10645, 11237-11251, 12490-12503, 13362-13376, 13609-13622, 14102-14115, 14449-14462, 14821-14834, 15079-15092

🤖 Prompt for AI Agents
fern/openapi/skyvern_openapi.json lines 4098-4113: the description for
next_block_label contains a leaked internal anchor reference "See [[s-4bnl]]"
which should not appear in public docs; remove that fragment or replace it with
a valid public reference (or a short explanatory sentence such as "Defaults to
sequential order."), and apply the same change to the other occurrences at
ranges 5736-5750, 6519-6533, 6942-6956, 7363-7377, 7743-7757, 7980-7994,
8812-8825, 9264-9277, 9902-9915, 10631-10645, 11237-11251, 12490-12503,
13362-13376, 13609-13622, 14102-14115, 14449-14462, 14821-14834, and 15079-15092
so all descriptions no longer reference the internal anchor.

Comment on lines +5794 to +5859
"ConditionalBlock": {
"properties": {
"label": {
"type": "string",
"title": "Label",
"description": "Author-facing identifier for a block; unique within a workflow."
},
"next_block_label": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Next Block Label",
"description": "Optional pointer to the next block label when constructing a DAG. Defaults to sequential order when omitted."
},
"block_type": {
"type": "string",
"const": "conditional",
"title": "Block Type",
"default": "conditional"
},
"output_parameter": {
"$ref": "#/components/schemas/OutputParameter"
},
"continue_on_failure": {
"type": "boolean",
"title": "Continue On Failure",
"default": false
},
"model": {
"anyOf": [
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"title": "Model"
},
"disable_cache": {
"type": "boolean",
"title": "Disable Cache",
"default": false
},
"branches": {
"items": {
"$ref": "#/components/schemas/BranchCondition"
},
"type": "array",
"title": "Branches"
}
},
"type": "object",
"required": [
"label",
"output_parameter"
],
"title": "ConditionalBlock",
"description": "Branching block that selects the next block label based on ordered conditions."
},
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

Conditional branching constraints under-specified; likely validation gaps.

  • BranchCondition.next_block_label is optional; selecting a branch without a target should be invalid.
  • ConditionalBlock.branches has no minItems or requirement for a default branch; evaluation order semantics aren’t enforced.
  • BranchCriteria is an abstract shell with only criteria_type and no discriminator/variants, making client validation and tooling weak.

Recommendations (schema-level):

  • Require next_block_label in BranchCondition.
  • Add "minItems": 1 to ConditionalBlock.branches; consider requiring exactly one is_default=true (can be checked server-side if not feasible in JSON Schema).
  • Define concrete BranchCriteria variants with oneOf + discriminator so SDKs and validators can enforce structure.

Also applies to: 5184-5235, 5236-5260


I'll verify the schema constraints in the OpenAPI file by examining the actual definitions.


🏁 Script executed:

#!/bin/bash
# Search for BranchCondition, BranchCriteria, and ConditionalBlock definitions
rg -n "\"(BranchCondition|BranchCriteria|ConditionalBlock)\"" fern/openapi/skyvern_openapi.json | head -20

Length of output: 218


🏁 Script executed:

#!/bin/bash
# Extract and display BranchCondition schema
jq '.components.schemas.BranchCondition' fern/openapi/skyvern_openapi.json 2>/dev/null | head -50

Length of output: 834


🏁 Script executed:

#!/bin/bash
# Extract and display BranchCriteria schema
jq '.components.schemas.BranchCriteria' fern/openapi/skyvern_openapi.json 2>/dev/null

Length of output: 469


🏁 Script executed:

#!/bin/bash
# Extract ConditionalBlock.branches property to check for minItems
jq '.components.schemas.ConditionalBlock.properties.branches' fern/openapi/skyvern_openapi.json 2>/dev/null

Length of output: 113


🏁 Script executed:

#!/bin/bash
# Check for YAML variants (e.g., ConditionalBlockYAML, BranchConditionYAML)
rg -n "\"(ConditionalBlockYAML|BranchConditionYAML)\"" fern/openapi/skyvern_openapi.json

Length of output: 0


🏁 Script executed:

#!/bin/bash
# Count total required fields in ConditionalBlock
jq '.components.schemas.ConditionalBlock.required' fern/openapi/skyvern_openapi.json 2>/dev/null

Length of output: 35


🏁 Script executed:

#!/bin/bash
# Check BranchCondition required fields
jq '.components.schemas.BranchCondition.required' fern/openapi/skyvern_openapi.json 2>/dev/null

Length of output: 13


🏁 Script executed:

#!/bin/bash
# Search for next_block_label in BranchCondition properties
jq '.components.schemas.BranchCondition.properties.next_block_label' fern/openapi/skyvern_openapi.json 2>/dev/null

Length of output: 120


🏁 Script executed:

#!/bin/bash
# Look for discriminator in BranchCriteria
jq '.components.schemas.BranchCriteria | keys' fern/openapi/skyvern_openapi.json 2>/dev/null

Length of output: 70


🏁 Script executed:

#!/bin/bash
# List all properties in BranchCriteria
jq '.components.schemas.BranchCriteria' fern/openapi/skyvern_openapi.json 2>/dev/null

Length of output: 469


🏁 Script executed:

#!/bin/bash
# Extract line numbers and context for the mentioned line ranges
sed -n '5794,5859p' fern/openapi/skyvern_openapi.json | head -30

Length of output: 976


🏁 Script executed:

#!/bin/bash
# Check lines 5184-5235 for schema definitions
sed -n '5184,5235p' fern/openapi/skyvern_openapi.json | grep -E '(BranchCondition|BranchCriteria|required|minItems|discriminator)' | head -20

Length of output: 146


🏁 Script executed:

#!/bin/bash
# Check lines 5236-5260 for schema definitions
sed -n '5236,5260p' fern/openapi/skyvern_openapi.json | grep -E '(BranchCondition|BranchCriteria|required|minItems|discriminator)' | head -20

Length of output: 82


🏁 Script executed:

#!/bin/bash
# Full BranchCondition schema inspection
jq '.components.schemas.BranchCondition' fern/openapi/skyvern_openapi.json 2>/dev/null | jq -r 'tostring'

Length of output: 550


🏁 Script executed:

#!/bin/bash
# Full ConditionalBlock schema inspection
jq '.components.schemas.ConditionalBlock' fern/openapi/skyvern_openapi.json 2>/dev/null | jq -r 'tostring' | head -80

Length of output: 1061


🏁 Script executed:

#!/bin/bash
# List all schema names containing "Branch" or "Conditional"
jq '.components.schemas | keys[] | select(contains("Branch") or contains("Conditional"))' fern/openapi/skyvern_openapi.json 2>/dev/null

Length of output: 53


🏁 Script executed:

#!/bin/bash
# Check for any schema using oneOf with BranchCriteria
jq '.components.schemas | to_entries[] | select(.value.oneOf != null and (.value.oneOf | tostring | contains("BranchCriteria"))) | .key' fern/openapi/skyvern_openapi.json 2>/dev/null

Length of output: 0


🏁 Script executed:

#!/bin/bash
# Search for discriminator in any schema
rg -n "discriminator" fern/openapi/skyvern_openapi.json | head -10

Length of output: 384


🏁 Script executed:

#!/bin/bash
# Check specific lines to understand ConditionalBlock.branches definition
sed -n '5810,5830p' fern/openapi/skyvern_openapi.json

Length of output: 730


🏁 Script executed:

#!/bin/bash
# Extract references to BranchCondition throughout the file
rg -n "\$ref.*BranchCondition" fern/openapi/skyvern_openapi.json

Length of output: 0


🏁 Script executed:

#!/bin/bash
# Check BranchCondition full definition with line numbers
rg -n -A 30 "\"BranchCondition\": {" fern/openapi/skyvern_openapi.json | head -50

Length of output: 103


🏁 Script executed:

#!/bin/bash
# Check BranchCriteria full definition with line numbers
rg -n -A 30 "\"BranchCriteria\": {" fern/openapi/skyvern_openapi.json | head -50

Length of output: 101


🏁 Script executed:

#!/bin/bash
# Validate JSON syntax and structure
python3 << 'EOF'
import json
try:
    with open('fern/openapi/skyvern_openapi.json', 'r') as f:
        data = json.load(f)
    
    # Check BranchCondition
    if 'BranchCondition' in data.get('components', {}).get('schemas', {}):
        bc = data['components']['schemas']['BranchCondition']
        print("=== BranchCondition ===")
        print(f"Required fields: {bc.get('required', [])}")
        print(f"Properties: {list(bc.get('properties', {}).keys())}")
        print(f"next_block_label in required: {'next_block_label' in bc.get('required', [])}")
    
    # Check ConditionalBlock.branches
    if 'ConditionalBlock' in data.get('components', {}).get('schemas', {}):
        cb = data['components']['schemas']['ConditionalBlock']
        branches = cb.get('properties', {}).get('branches', {})
        print("\n=== ConditionalBlock.branches ===")
        print(f"minItems: {branches.get('minItems', 'NOT SET')}")
        print(f"type: {branches.get('type')}")
        print(f"Full definition: {json.dumps(branches, indent=2)}")
    
    # Check BranchCriteria
    if 'BranchCriteria' in data.get('components', {}).get('schemas', {}):
        brc = data['components']['schemas']['BranchCriteria']
        print("\n=== BranchCriteria ===")
        print(f"Properties: {list(brc.get('properties', {}).keys())}")
        print(f"Has oneOf: {'oneOf' in brc}")
        print(f"Has discriminator: {'discriminator' in brc}")
        print(f"Type: {brc.get('type')}")
        print(f"Full definition: {json.dumps(brc, indent=2)}")
        
except Exception as e:
    print(f"Error: {e}")
EOF

Length of output: 976


Conditional branching constraints are under-specified; validation gaps confirmed.

Verification of the schema confirms all three core issues:

  1. BranchCondition.next_block_label is optional — not listed in required fields; a branch may exist without a target.
  2. ConditionalBlock.branches has no minItems — array can be empty; no schema enforcement of default routing.
  3. BranchCriteria lacks discriminator and variants — defined as an abstract interface with only criteria_type, but no oneOf or discriminator to enforce concrete implementations. Other schemas in the file successfully use discriminators (e.g., at lines 286, 4001, 5696).

Recommended fixes:

  • Require next_block_label in BranchCondition, or enforce runtime validation if optional design is intentional.
  • Add "minItems": 1 to ConditionalBlock.branches.
  • Replace BranchCriteria with oneOf + discriminator pattern to define concrete criteria variants.

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