Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Getting started with Typespec ARM specifications

Swagger APIs and examples are generated from Typespec definitions in folder `DocumentDB.MongoCluster.Management`.
Swagger APIs and examples are generated from TypeSpec definitions in folder `resource-manager/Microsoft.DocumentDB/MongoCluster`.

The generated specs and examples are located under `resource-manager/Microsoft.DocumentDB` and should not be edited directly.
The generated specs and examples are located under `resource-manager/Microsoft.DocumentDB/MongoCluster/preview` and `resource-manager/Microsoft.DocumentDB/MongoCluster/stable` directories and should not be edited directly.

# Setup local environment

Expand All @@ -12,30 +12,31 @@ See instructions [here](https://github.com/Azure/azure-rest-api-specs/blob/main/

```
mongocluster
├── DocumentDB.MongoCluster.Management [ARM API TypeSpec Definition]
| ├── tspconfig.yaml
| ├── main.tsp
| ├── MongoCluster.tsp
| ├── common.tsp
| ├── ...
| └── examples [API Examples]
| ├── 2023-11-15-preview
| | ├── MongoClusterCreate.json
| | ├── MongoClusterGet.json
| | ├── ...
| └── 2024-03-01-preview
| ├── ...
└── resource-manager
└── Microsoft.DocumentDB
└── preview
├── 2023-11-15-preview
| ├── mongoCluster.json [Swagger specs generated from TypeSpec]
| └── examples
| | └── ... [examples generated from TypeSpec]
| └── scenarios [API Test Scenarios - non-generated]
| └── basic.yaml
├── 2024-03-01-preview
├── ...
└── MongoCluster
├──tspconfig.yaml ┐
├──main.tsp │
├──MongoCluster.tsp | [ARM API TypeSpec Definition]
├──common.tsp │
├──... ┘
├──examples [API Examples]
| ├── 2023-11-15-preview
| | ├── MongoClusterCreate.json
| | ├── MongoClusterGet.json
| | ├── ...
| └── 2024-03-01-preview
| ├── ...
|
└── preview
├── 2023-11-15-preview
| ├── mongoCluster.json [Swagger specs generated from TypeSpec]
| └── examples
| | └── ... [examples generated from TypeSpec]
| └── scenarios [API Test Scenarios - non-generated]
| └── basic.yaml
├── 2024-03-01-preview
├── ...
```

# Authoring Typespec definition
Expand All @@ -54,14 +55,13 @@ Use VS Code to edit TypeSpec definition files.

# Compiling TypeSpec

From folder `DocumentDB.MongoCluster.Management`, run:
From folder `resource-manager/Microsoft.DocumentDB/MongoCluster`, run:

```bash
npx tsp compile .
```

This will re-generate the Swagger API specifications nuder `resource-manager/Microsoft.DocumentDB`.
Assuming you have made no updates, this should make no changes to the files.
This will re-generate the Swagger API specifications under `resource-manager/Microsoft.DocumentDB/MongoCluster`. Assuming you have made no updates, this should make no changes to the files.

# Management API scenario tests

Expand All @@ -76,15 +76,16 @@ API scenario file are located alongside examples for each API version
mongocluster
└── resource-manager
└── Microsoft.DocumentDB
├── preview
├── 2023-11-15-preview
| ├── ...
| └── scenarios
| └── basic.yaml
└── 2024-03-01-preview
└── scenarios
├── basic.yaml
└── new-scenario.yaml
└── MongoCluster
└── preview
├── 2023-11-15-preview
| ├── ...
| └── scenarios
| └── basic.yaml
└── 2024-03-01-preview
└── scenarios
├── basic.yaml
└── new-scenario.yaml
```

## Adding or editing scenario definitions
Expand All @@ -101,4 +102,4 @@ Example Scenarios:

## Running API scenarios for Mongo Clusters API

**Full instructions on [wiki page here](https://msdata.visualstudio.com/CosmosDB/_git/pgmongo?path=/docs/pgmongo/mongo_arm/api_specification/typespec-authoring.md&version=GBolivert/arm_spec_docs&_a=preview)**
**Full instructions on [wiki page here](https://msdata.visualstudio.com/CosmosDB/_git/pgmongo?path=/docs/pgmongo/mongo_arm/api_specification/typespec-authoring.md&version=GBolivert/arm_spec_docs&_a=preview)**
Loading
Loading