Skip to content

Commit a312042

Browse files
committed
Improve Generic HTTP integration docs - Phase 1
- Add JQ reference link in prerequisites - Add two-step setup link in overview - Add descriptive text before each interactive step - Fix field deselection (toggle ID/Title buttons) - Auto-select first array in JSON response - Auto-generate blueprint ID and title with singularization - Update form hints with explicit defaults - Simplify configuration explanations - Remove redundant copy buttons - Fix mapping generation (query and blueprint quoting) - Fix authentication config (use apiToken/apiKey/username+password) - Fix image versioning (use integration.version instead of image.tag) - Update to version 0.1.5-dev - Add pluralize dependency for accurate singularization
1 parent acc0b8d commit a312042

File tree

13 files changed

+147
-63
lines changed

13 files changed

+147
-63
lines changed

docs/build-your-software-catalog/custom-integration/ocean-http/build-your-integration.md

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,24 +22,47 @@ This interactive guide will help you generate everything you need to connect you
2222

2323
## Step 1: Configure Your API
2424

25-
Set up the connection details for your API:
25+
Set up the connection details for your API. These settings apply globally to all endpoints you'll sync from this API.
26+
27+
**What you're configuring:**
28+
- **Base URL**: The root URL that all endpoint paths will be appended to
29+
- **Authentication**: How your API verifies requests (bearer token, API key, basic auth, or none)
30+
- **Pagination** (optional): How to fetch data across multiple pages if your API uses pagination
31+
- **Performance settings** (optional): Timeouts, concurrent requests, SSL verification
32+
33+
Think of this as setting up the "connection" - these settings will be used for every API call the integration makes.
2634

2735
<Step1ApiConfig />
2836

2937
---
3038

3139
## Step 2: Choose What Data to Sync
3240

33-
Select an endpoint and configure which fields to ingest into Port:
41+
Now that your API connection is configured, let's define what data to sync. This step helps you map a specific API endpoint to a Port blueprint.
42+
43+
**What you'll do:**
44+
1. **Specify the endpoint path** (e.g., `/api/v1/users`) that you want to sync
45+
2. **Paste a sample API response** so we can detect the data structure
46+
3. **Select the data path** - tell us where the array of items is in the response (e.g., `.data`, `.users`, or root array)
47+
4. **Configure the blueprint** - give it an identifier and title
48+
5. **Choose which fields to sync** - select the fields you want to ingest and mark which field is the unique identifier
49+
50+
The builder will automatically detect field types (string, number, boolean, email, date, URL) from your sample response.
3451

3552
<Step2DataMapping />
3653

3754
---
3855

3956
## Step 3: Install and Create in Port
4057

41-
Use the commands and configurations generated from your selections above.
58+
You're all set! Based on your configuration, we've generated everything you need:
59+
60+
**What you'll get:**
61+
- **Installation commands** (Helm or Docker) with all your settings pre-configured
62+
- **Blueprint JSON** to create the data model in Port
63+
- **Mapping YAML** to configure which fields to sync
4264

65+
Simply copy and run these in order to complete your integration setup.
4366

4467
<Step3Installation />
4568

docs/build-your-software-catalog/custom-integration/ocean-http/overview.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,13 @@ Where is the actual data in your API's response?
7979
}
8080
```
8181

82-
You'll use a JQ `data_path` in your mapping to tell the integration where to find the array of items.
82+
You'll use a [JQ](https://jqlang.org/manual/) `data_path` expression in your mapping to tell the integration where to find the array of items (e.g., `.data`, `.users.items`).
8383

8484
---
8585

8686
## How It Works
8787

88-
The Generic HTTP integration uses a **two-step setup** similar to other Ocean integrations you've used:
88+
The Generic HTTP integration uses a [**two-step setup**](/build-your-software-catalog/sync-data-to-catalog/) similar to other Ocean integrations you've used:
8989

9090
### Step 1: Installation (Global Configuration)
9191

package-lock.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
"docusaurus-plugin-image-zoom": "^3.0.1",
3737
"docusaurus-plugin-openapi-docs": "^4.5.1",
3838
"docusaurus-theme-openapi-docs": "^4.5.1",
39+
"pluralize": "^8.0.0",
3940
"prettier": "^3.6.2",
4041
"prism-react-renderer": "^2.4.1",
4142
"react": "^19.2.0",

src/components/GenericHttp/ApiConfigBuilder.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,3 +207,4 @@ export function ApiConfigBuilder() {
207207
);
208208
}
209209

210+

src/components/GenericHttp/BlueprintGenerator.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,3 +155,4 @@ export function BlueprintGenerator() {
155155
);
156156
}
157157

158+

src/components/GenericHttp/ConfigGenerator.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,3 +186,4 @@ export function ConfigGenerator() {
186186
);
187187
}
188188

189+

src/components/GenericHttp/EndpointTester.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,3 +124,4 @@ export function EndpointTester() {
124124
);
125125
}
126126

127+

src/components/GenericHttp/IntegrationBuilder.jsx

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export function IntegrationBuilder() {
7979

8080
return `docker run -d --name ocean-http-integration \\
8181
${envVars.join(' \\\n')} \\
82-
ghcr.io/port-labs/port-ocean-generic-http:latest`;
82+
ghcr.io/port-labs/port-ocean-generic-http:0.1.5-dev`;
8383
};
8484

8585
const generateHelmValues = () => {
@@ -97,30 +97,37 @@ ${envVars.join(' \\\n')} \\
9797
config.apiKeyHeader = apiKeyHeader;
9898
}
9999

100-
let authValue = '';
100+
// Build auth config
101+
let authConfig = '';
101102
if (authType === 'bearer_token') {
102-
authValue = apiToken || '<YOUR_API_TOKEN>';
103+
authConfig = `
104+
apiToken: ${apiToken || '<YOUR_API_TOKEN>'}`;
103105
} else if (authType === 'api_key') {
104-
authValue = apiKey || '<YOUR_API_KEY>';
106+
authConfig = `
107+
apiKey: ${apiKey || '<YOUR_API_KEY>'}`;
108+
if (apiKeyHeader !== 'X-API-Key') {
109+
authConfig += `
110+
apiKeyHeader: ${apiKeyHeader}`;
111+
}
105112
} else if (authType === 'basic') {
106-
authValue = `${username || '<USERNAME>'}:${password || '<PASSWORD>'}`;
113+
authConfig = `
114+
username: ${username || '<USERNAME>'}
115+
password: ${password || '<PASSWORD>'}`;
107116
}
108117

109118
return `initializePortResources: true
110119
scheduledResyncInterval: 60
111120
integration:
112121
identifier: generic-http
113122
type: generic-http
123+
version: 0.1.5-dev
114124
eventListener:
115125
type: POLLING
116126
config:
117127
baseUrl: ${config.baseUrl}
118-
authType: ${config.authType}${config.paginationType ? `
128+
authType: ${config.authType}${authConfig}${config.paginationType ? `
119129
paginationType: ${config.paginationType}
120-
pageSize: ${config.pageSize}` : ''}${config.apiKeyHeader ? `
121-
apiKeyHeader: ${config.apiKeyHeader}` : ''}${authType !== 'none' ? `
122-
secrets:
123-
authValue: ${authValue}` : ''}
130+
pageSize: ${config.pageSize}` : ''}
124131
port:
125132
clientId: <PORT_CLIENT_ID>
126133
clientSecret: <PORT_CLIENT_SECRET>`;

src/components/GenericHttp/IntegrationBuilderSteps.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ export function IntegrationBuilderSteps() {
1414
);
1515
}
1616

17+

0 commit comments

Comments
 (0)