Skip to content

Commit 1e8b0c5

Browse files
farioasbenglewis
andauthored
fix: Python SyntaxWarning: invalid escape sequence warnings from code generated by Fern (mirror) (#81)
Co-authored-by: Ben Lewis <hello@blewis.me>
1 parent 1faeabf commit 1e8b0c5

File tree

3 files changed

+21
-38
lines changed

3 files changed

+21
-38
lines changed

fern/openapi/openapi.yaml

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1473,9 +1473,9 @@ paths:
14731473
14741474
```bash
14751475
1476-
curl -X POST -H 'Content-type: application/json' https://localhost:8080/api/ml -H 'Authorization: Token abc123'\
1476+
curl -X POST -H 'Content-type: application/json' https://localhost:8080/api/ml -H 'Authorization: Token abc123' --data '{"url": "http://localhost:9090", "project": {project_id}}'
14771477
1478-
--data '{"url": "http://localhost:9090", "project": {project_id}}'
1478+
```
14791479
requestBody:
14801480
$ref: "#/components/requestBodies/api_ml_createData"
14811481
responses:
@@ -2404,7 +2404,7 @@ paths:
24042404
control tag named my_bbox should be included with 0.33 weight
24052405
in agreement calculation, and the first label Car should be
24062406
twice as important as Airplane, then you need to specify:
2407-
\{'my_bbox': \{'type': 'RectangleLabels', 'labels': \{'Car': 1.0,
2407+
{'my_bbox': {'type': 'RectangleLabels', 'labels': {'Car': 1.0,
24082408
'Airplane': 0.5}, 'overall': 0.33}}
24092409
type: object
24102410
example:
@@ -2595,7 +2595,7 @@ paths:
25952595
control tag named my_bbox should be included with 0.33 weight
25962596
in agreement calculation, and the first label Car should be
25972597
twice as important as Airplane, then you need to specify:
2598-
\{'my_bbox': \{'type': 'RectangleLabels', 'labels': \{'Car': 1.0,
2598+
{'my_bbox': {'type': 'RectangleLabels', 'labels': {'Car': 1.0,
25992599
'Airplane': 0.5}, 'overall': 0.33}}
26002600
type: object
26012601
example:
@@ -2723,7 +2723,7 @@ paths:
27232723
There are three possible ways to import tasks with this endpoint:
27242724
27252725
2726-
### 1\. **POST with data**
2726+
### 1. **POST with data**
27272727
27282728
Send JSON tasks as POST data. Only JSON is supported for POSTing files directly.
27292729
@@ -2734,14 +2734,12 @@ paths:
27342734
27352735
```bash
27362736
2737-
curl -H 'Content-Type: application/json' -H 'Authorization: Token abc123' \
2738-
2739-
-X POST 'https://localhost:8080/api/projects/1/import' --data '[{"text": "Some text 1"}, {"text": "Some text 2"}]'
2737+
curl -H 'Content-Type: application/json' -H 'Authorization: Token abc123' -X POST 'https://localhost:8080/api/projects/1/import' --data '[{"text": "Some text 1"}, {"text": "Some text 2"}]'
27402738
27412739
```
27422740
27432741
2744-
### 2\. **POST with files**
2742+
### 2. **POST with files**
27452743
27462744
Send tasks as files. You can attach multiple files with different names.
27472745
@@ -2762,25 +2760,19 @@ paths:
27622760
27632761
```bash
27642762
2765-
curl -H 'Authorization: Token abc123' \
2766-
2767-
-X POST 'https://localhost:8080/api/projects/1/import' -F ‘file=@path/to/my_file.csv’
2763+
curl -H 'Authorization: Token abc123' -X POST 'https://localhost:8080/api/projects/1/import' -F 'file=@path/to/my_file.csv'
27682764
27692765
```
27702766
27712767
2772-
### 3\. **POST with URL**
2768+
### 3. **POST with URL**
27732769
27742770
You can also provide a URL to a file with labeling tasks. Supported file formats are the same as in option 2.
27752771
27762772
27772773
```bash
27782774
2779-
curl -H 'Content-Type: application/json' -H 'Authorization: Token abc123' \
2780-
2781-
-X POST 'https://localhost:8080/api/projects/1/import' \
2782-
2783-
--data '[{"url": "http://example.com/test1.csv"}, {"url": "http://example.com/test2.csv"}]'
2775+
curl -H 'Content-Type: application/json' -H 'Authorization: Token abc123' -X POST 'https://localhost:8080/api/projects/1/import' --data '[{"url": "http://example.com/test1.csv"}, {"url": "http://example.com/test2.csv"}]'
27842776
27852777
```
27862778
@@ -6710,7 +6702,7 @@ components:
67106702
control tag named my_bbox should be included with 0.33 weight
67116703
in agreement calculation, and the first label Car should be
67126704
twice as important as Airplane, then you need to specify:
6713-
\{'my_bbox': \{'type': 'RectangleLabels', 'labels': \{'Car': 1.0,
6705+
{'my_bbox': {'type': 'RectangleLabels', 'labels': {'Car': 1.0,
67146706
'Airplane': 0.5}, 'overall': 0.33}}
67156707
type: object
67166708
example:
@@ -8652,7 +8644,7 @@ components:
86528644
control tag named my_bbox should be included with 0.33 weight
86538645
in agreement calculation, and the first label Car should be
86548646
twice as important as Airplane, then you need to specify:
8655-
\{'my_bbox': \{'type': 'RectangleLabels', 'labels': \{'Car': 1.0,
8647+
{'my_bbox': {'type': 'RectangleLabels', 'labels': {'Car': 1.0,
86568648
'Airplane': 0.5}, 'overall': 0.33}}
86578649
type: object
86588650
nullable: true

fern/openapi/overrides.yaml

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -571,8 +571,7 @@ paths:
571571
572572
```bash
573573
574-
curl -H 'Authorization: Token abc123' \
575-
-X POST 'https://localhost:8080/api/import/file-upload/245' -F ‘file=@path/to/my_file.csv’
574+
curl -H 'Authorization: Token abc123' -X POST 'https://localhost:8080/api/import/file-upload/245' -F 'file=@path/to/my_file.csv'
576575
577576
```
578577
@@ -841,7 +840,7 @@ paths:
841840
There are three possible ways to import tasks with this endpoint:
842841
843842
844-
#### 1\. **POST with data**
843+
#### 1. **POST with data**
845844
846845
Send JSON tasks as POST data. Only JSON is supported for POSTing files directly.
847846
@@ -853,14 +852,12 @@ paths:
853852
854853
```bash
855854
856-
curl -H 'Content-Type: application/json' -H 'Authorization: Token abc123' \
857-
858-
-X POST 'https://localhost:8080/api/projects/1/import' --data '[{"text": "Some text 1"}, {"text": "Some text 2"}]'
855+
curl -H 'Content-Type: application/json' -H 'Authorization: Token abc123' -X POST 'https://localhost:8080/api/projects/1/import' --data '[{"text": "Some text 1"}, {"text": "Some text 2"}]'
859856
860857
```
861858
862859
863-
#### 2\. **POST with files**
860+
#### 2. **POST with files**
864861
865862
Send tasks as files. You can attach multiple files with different names.
866863
@@ -881,25 +878,19 @@ paths:
881878
882879
```bash
883880
884-
curl -H 'Authorization: Token abc123' \
885-
886-
-X POST 'https://localhost:8080/api/projects/1/import' -F ‘file=@path/to/my_file.csv’
881+
curl -H 'Authorization: Token abc123' -X POST 'https://localhost:8080/api/projects/1/import' -F 'file=@path/to/my_file.csv'
887882
888883
```
889884
890885
891-
#### 3\. **POST with URL**
886+
#### 3. **POST with URL**
892887
893888
You can also provide a URL to a file with labeling tasks. Supported file formats are the same as in option 2.
894889
895890
896891
```bash
897892
898-
curl -H 'Content-Type: application/json' -H 'Authorization: Token abc123' \
899-
900-
-X POST 'https://localhost:8080/api/projects/1/import' \
901-
902-
--data '[{"url": "http://example.com/test1.csv"}, {"url": "http://example.com/test2.csv"}]'
893+
curl -H 'Content-Type: application/json' -H 'Authorization: Token abc123' -X POST 'https://localhost:8080/api/projects/1/import' --data '[{"url": "http://example.com/test1.csv"}, {"url": "http://example.com/test2.csv"}]'
903894
904895
```
905896
@@ -3024,7 +3015,7 @@ components:
30243015
control tag named my_bbox should be included with 0.33 weight
30253016
in agreement calculation, and the first label Car should be
30263017
twice as important as Airplane, then you need to specify:
3027-
\{'my_bbox': \{'type': 'RectangleLabels', 'labels': \{'Car': 1.0,
3018+
{'my_bbox': {'type': 'RectangleLabels', 'labels': {'Car': 1.0,
30283019
'Airplane': 0.5}, 'overall': 0.33}}
30293020
type: object
30303021
example:

fern/openapi/resources/exports.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ paths:
239239
240240
```bash
241241
242-
curl -X GET https://localhost:8080/api/projects/{id}/export?ids[]=123\&ids[]=345 -H 'Authorization: Token abc123' --output 'annotations.json'
242+
curl -X GET "https://localhost:8080/api/projects/{id}/export?ids[]=123&ids[]=345" -H 'Authorization: Token abc123' --output 'annotations.json'
243243
244244
```
245245

0 commit comments

Comments
 (0)