File: SWAGGER.md

package info (click to toggle)
python-azure 20251118%2Bgit-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 783,356 kB
  • sloc: python: 6,474,533; ansic: 804; javascript: 287; sh: 205; makefile: 198; xml: 109
file content (61 lines) | stat: -rw-r--r-- 1,373 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# Azure Communication Services Email REST API Client

> see https://aka.ms/autorest

### Setup
```ps
npm install -g autorest
```

### Generation
```ps
cd <swagger-folder>
autorest SWAGGER.md
```

### Settings
``` yaml
package-version: 1.1.0
tag: package-2025-09-01
require: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/83327afe471d7a2eb923de58b163658d45e0e5a7/specification/communication/data-plane/Email/readme.md
output-folder: ../azure/communication/email
namespace: azure.communication.email
no-namespace-folders: true
license-header: MICROSOFT_MIT_NO_VERSION
enable-xml: true
clear-output-folder: false
python: true
v3: true
no-async: false
add-credential: false
security: Anonymous
title: Email Client
use-extension:
  "@autorest/python": "6.40.0"
```

### Ensure contentInBase64 is a string

```yaml
directive:
  - from: swagger-document
    where: $.definitions.EmailAttachment.properties.contentInBase64
    transform: >
      $["type"] = "string";
      if ($["format"]) {
        delete $["format"];
      }
```

### Flatten operations by removing operation group prefixes

```yaml
directive:
  - from: swagger-document
    where: $.paths.*.*
    transform: >
      if ($["operationId"] && $["operationId"].startsWith("Email_")) {
        $["operationId"] = $["operationId"].replace("Email_", "");
      }
  - remove-operation: GetSendResult
```