You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(proposal): add EXPORT CONTRACT for published service contract generation
Add contract generation section to Phase 2, mirroring Studio Pro's ability
to download/generate contracts for published services:
- Published REST → OpenAPI 3.0 JSON
- Published OData → $metadata XML (+ optional GraphQL schema)
- Business Event Service → AsyncAPI YAML
- EXPORT CONTRACT syntax with FORMAT and TO options
- Auto-detect format based on service type when FORMAT omitted
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: docs/11-proposals/integration-pane-proposal.md
+44Lines changed: 44 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -409,6 +409,50 @@ SQL mydb SHOW TABLES;
409
409
SQL mydb DESCRIBE TABLE orders;
410
410
```
411
411
412
+
### Contract Generation for Published Services
413
+
414
+
Studio Pro can generate/download contracts for published services (OpenAPI for REST, `$metadata` for OData, GraphQL schema for OData, AsyncAPI for business events). We need the same in MDL so users can export a current contract for services defined in their project.
415
+
416
+
#### Published REST → OpenAPI
417
+
```sql
418
+
-- Generate OpenAPI 3.0 JSON from a published REST service definition
419
+
EXPORT CONTRACT FROMMyModule.CustomerAPI FORMAT openapi;
420
+
EXPORT CONTRACT FROMMyModule.CustomerAPI FORMAT openapi TO '/path/to/openapi.json';
421
+
```
422
+
423
+
Generate by mapping published REST resources and operations to OpenAPI paths, methods, and parameters. Include microflow return types as response schemas where inferrable.
424
+
425
+
#### Published OData → `$metadata` / GraphQL
426
+
```sql
427
+
-- Generate OData $metadata XML from a published OData service definition
428
+
EXPORT CONTRACT FROMMyModule.ProductAPI FORMAT odata;
429
+
EXPORT CONTRACT FROMMyModule.ProductAPI FORMAT odata TO '/path/to/metadata.xml';
430
+
431
+
-- Generate GraphQL schema from a published OData service (optional, OData4 only)
432
+
EXPORT CONTRACT FROMMyModule.ProductAPI FORMAT graphql;
433
+
```
434
+
435
+
Generate by mapping published entity types, entity sets, exposed members, and CRUD modes to EDMX/CSDL. The GraphQL variant maps entity sets to queries and CUD modes to mutations.
436
+
437
+
#### Business Event Service → AsyncAPI
438
+
```sql
439
+
-- Generate AsyncAPI YAML from a business event service definition
440
+
EXPORT CONTRACT FROMMyModule.OrderEvents FORMAT asyncapi;
441
+
EXPORT CONTRACT FROMMyModule.OrderEvents FORMAT asyncapi TO '/path/to/asyncapi.yaml';
442
+
```
443
+
444
+
Generate by mapping channels, messages, and attributes from the structured `Definition` to AsyncAPI 2.x format with CloudEvents headers.
445
+
446
+
#### Default Behavior
447
+
```sql
448
+
-- Without FORMAT, auto-detect based on service type
0 commit comments