bytechefhq / bytechefhq/bytechef

[feature] Add Support for `x-control-type` Extension in OpenAPI Specification for Connector Generation

Open
#3,474 0 comments 0 reactions 1 assignee Claimed by @monikakuster View on GitHub
backend cli enhancement
Dominant language
Java
Stars
1k
Forks
170
Avg merge
11h 25m
Merged PRs (30d)
115

Description

As a connector developer, I want to define the x-control-type extension in my OpenAPI specification so that the generated connector code accurately reflects the intended UI control type for each property.

**Example OpenAPI Specification:**

```
requestBody:
content:
application/json:
schema:
type: "object"
title: "Message"
required:
- "content"
properties:
content:
type: "string"
title: "Message Text"
description: "Message contents (up to 2000 characters)"
x-control-type: "textarea"
```

**Expected Generated Code:**

```
string("content").metadata(
Map.of(
"type", PropertyType.BODY))
.label("Message Text")
.description("Message contents (up to 2000 characters)")
.controlType(Property.ControlType.TEXT_AREA)
.required(true),
```

Available control types can be found [here](https://github.com/bytechefhq/bytechef/blob/master/sdks/backend/java/component-api/src/main/java/com/bytechef/component/definition/Property.java#L36).

**Acceptance Criteria:**

- The connector generator should recognize and process the `x-control-type` extension in the OpenAPI specification.
- The generated code should set the appropriate `.controlType() `based on the value of `x-control-type`.
- Documentation should be updated to reflect support for this extension.

**Benefit:**
This enhancement will allow connector developers to have finer control over the UI representation of input fields, improving both usability and consistency in generated connectors.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.