Skip to content

Commit 70c616e

Browse files
khode-mxclaude
andcommitted
docs: document BaseUrl override for OpenAPI import in quick ref and skill
Add BaseUrl override example and explanation to both MDL_QUICK_REFERENCE.md and .claude/skills/mendix/rest-client.md. The behavior (BaseUrl overrides servers[0].url from the spec) was already implemented and tested but missing from both doc locations. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 653566c commit 70c616e

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

.claude/skills/mendix/rest-client.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ create or modify rest client CapitalModule.CapitalAPI (
3030
create or modify rest client PetStoreModule.PetStoreAPI (
3131
OpenAPI: 'https://petstore3.swagger.io/api/v3/openapi.json'
3232
);
33+
34+
-- Override the base URL (replaces servers[0].url from the spec)
35+
create or modify rest client PetStoreModule.PetStoreStaging (
36+
OpenAPI: 'https://petstore3.swagger.io/api/v3/openapi.json',
37+
BaseUrl: 'https://staging.petstore.example.com/api/v3'
38+
);
3339
```
3440

3541
This generates:
@@ -38,6 +44,8 @@ This generates:
3844
- Basic auth if the spec declares it at the top level
3945
- The spec stored inside the document for Studio Pro parity
4046

47+
`BaseUrl` is optional. When omitted, `servers[0].url` from the spec is used. When provided, it overrides that value — useful when the spec points at production but you need to import against staging or a different version.
48+
4149
**Preview without writing:**
4250
```sql
4351
describe contract operation from openapi 'specs/capital.json';

docs/01-project/MDL_QUICK_REFERENCE.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -611,12 +611,20 @@ create or modify rest client PetStoreModule.PetStoreAPI (
611611
OpenAPI: 'https://petstore3.swagger.io/api/v3/openapi.json'
612612
);
613613

614+
-- Override the base URL from the spec (e.g. point at staging instead of prod)
615+
create or modify rest client PetStoreModule.PetStoreStaging (
616+
OpenAPI: 'https://petstore3.swagger.io/api/v3/openapi.json',
617+
BaseUrl: 'https://staging.petstore.example.com/api/v3'
618+
);
619+
614620
-- Preview without writing to the project
615621
describe contract operation from openapi 'specs/capital.json';
616622
```
617623

618624
Operations, path/query parameters, headers, request body, response type, resource groups (from OpenAPI `tags`), and Basic auth are all derived automatically. The spec is stored inside the REST client document for Studio Pro parity.
619625

626+
`BaseUrl` is optional. When omitted, the base URL is taken from `servers[0].url` in the spec. When provided, it overrides that value — useful when the spec points at production but you want to import against a different environment.
627+
620628
## Published REST Services
621629

622630
| Statement | Syntax | Notes |

0 commit comments

Comments
 (0)