@typespec/http-specs 0.1.0-alpha.28-dev.0 → 0.1.0-alpha.28-dev.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -44,6 +44,18 @@ Scenarios.Encode_Duration_Property_float64Milliseconds = createBodyServerTests("
44
44
  Scenarios.Encode_Duration_Property_floatMillisecondsArray = createBodyServerTests("/encode/duration/property/float-milliseconds-array", {
45
45
  value: [35625, 46750],
46
46
  }, [35625, 46750]);
47
+ Scenarios.Encode_Duration_Property_int32SecondsLargerUnit = createBodyServerTests("/encode/duration/property/int32-seconds-larger-unit", {
48
+ value: 120,
49
+ }, 120);
50
+ Scenarios.Encode_Duration_Property_floatSecondsLargerUnit = createBodyServerTests("/encode/duration/property/float-seconds-larger-unit", {
51
+ value: 150.0,
52
+ }, 150.0);
53
+ Scenarios.Encode_Duration_Property_int32MillisecondsLargerUnit = createBodyServerTests("/encode/duration/property/int32-milliseconds-larger-unit", {
54
+ value: 180000,
55
+ }, 180000);
56
+ Scenarios.Encode_Duration_Property_floatMillisecondsLargerUnit = createBodyServerTests("/encode/duration/property/float-milliseconds-larger-unit", {
57
+ value: 210000.0,
58
+ }, 210000.0);
47
59
  function createQueryServerTests(uri, paramData, value, collectionFormat) {
48
60
  return passOnSuccess({
49
61
  uri,
@@ -93,6 +105,18 @@ Scenarios.Encode_Duration_Query_float64Milliseconds = createQueryServerTests("/e
93
105
  Scenarios.Encode_Duration_Query_int32MillisecondsArray = createQueryServerTests("/encode/duration/query/int32-milliseconds-array", {
94
106
  input: [36000, 47000].join(","),
95
107
  }, ["36000", "47000"], "csv");
108
+ Scenarios.Encode_Duration_Query_int32SecondsLargerUnit = createQueryServerTests("/encode/duration/query/int32-seconds-larger-unit", {
109
+ input: 120,
110
+ }, "120");
111
+ Scenarios.Encode_Duration_Query_floatSecondsLargerUnit = createQueryServerTests("/encode/duration/query/float-seconds-larger-unit", {
112
+ input: 150.0,
113
+ }, "150.0");
114
+ Scenarios.Encode_Duration_Query_int32MillisecondsLargerUnit = createQueryServerTests("/encode/duration/query/int32-milliseconds-larger-unit", {
115
+ input: 180000,
116
+ }, "180000");
117
+ Scenarios.Encode_Duration_Query_floatMillisecondsLargerUnit = createQueryServerTests("/encode/duration/query/float-milliseconds-larger-unit", {
118
+ input: 210000.0,
119
+ }, "210000.0");
96
120
  function createHeaderServerTests(uri, headersData, value) {
97
121
  return passOnSuccess({
98
122
  uri,
@@ -136,4 +160,16 @@ Scenarios.Encode_Duration_Header_float64Milliseconds = createHeaderServerTests("
136
160
  Scenarios.Encode_Duration_Header_int32MillisecondsArray = createHeaderServerTests("/encode/duration/header/int32-milliseconds-array", {
137
161
  duration: ["36000", "47000"].join(","),
138
162
  }, "36000,47000");
163
+ Scenarios.Encode_Duration_Header_int32SecondsLargerUnit = createHeaderServerTests("/encode/duration/header/int32-seconds-larger-unit", {
164
+ duration: "120",
165
+ }, "120");
166
+ Scenarios.Encode_Duration_Header_floatSecondsLargerUnit = createHeaderServerTests("/encode/duration/header/float-seconds-larger-unit", {
167
+ duration: "150.0",
168
+ }, "150.0");
169
+ Scenarios.Encode_Duration_Header_int32MillisecondsLargerUnit = createHeaderServerTests("/encode/duration/header/int32-milliseconds-larger-unit", {
170
+ duration: "180000",
171
+ }, "180000");
172
+ Scenarios.Encode_Duration_Header_floatMillisecondsLargerUnit = createHeaderServerTests("/encode/duration/header/float-milliseconds-larger-unit", {
173
+ duration: "210000.0",
174
+ }, "210000.0");
139
175
  //# sourceMappingURL=mockapi.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"mockapi.js","sourceRoot":"","sources":["../../../../specs/encode/duration/mockapi.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,IAAI,EAEJ,aAAa,GAEd,MAAM,oBAAoB,CAAC;AAE5B,MAAM,CAAC,MAAM,SAAS,GAAoC,EAAE,CAAC;AAE7D,SAAS,qBAAqB,CAAC,GAAW,EAAE,IAAS,EAAE,KAAU;IAC/D,OAA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MAAM,CACP,CAAC;AACF,SAAS,CAAC,mCAAmC,GAAG,uBAAuB,CACrE,uCAAuC,EACvC;IACE,QAAQ,EAAE,IAAI;CACf,EACD,IAAI,CACL,CAAC;AACF,SAAS,CAAC,mCAAmC,GAAG,uBAAuB,CACrE,uCAAuC,EACvC;IACE,QAAQ,EAAE,QAAQ;CACnB,EACD,QAAQ,CACT,CAAC;AACF,SAAS,CAAC,qCAAqC,GAAG,uBAAuB,CACvE,yCAAyC,EACzC;IACE,QAAQ,EAAE,QAAQ;CACnB,EACD,QAAQ,CACT,CAAC;AACF,SAAS,CAAC,mCAAmC,GAAG,uBAAuB,CACrE,uCAAuC,EACvC;IACE,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;CACrC,EACD,WAAW,CACZ,CAAC;AAEF,SAAS,CAAC,wCAAwC,GAAG,uBAAuB,CAC1E,4CAA4C,EAC5C;IACE,QAAQ,EAAE,OAAO;CAClB,EACD,OAAO,CACR,CAAC;AACF,SAAS,CAAC,wCAAwC,GAAG,uBAAuB,CAC1E,4CAA4C,EAC5C;IACE,QAAQ,EAAE,OAAO;CAClB,EACD,OAAO,CACR,CAAC;AACF,SAAS,CAAC,0CAA0C,GAAG,uBAAuB,CAC5E,8CAA8C,EAC9C;IACE,QAAQ,EAAE,OAAO;CAClB,EACD,OAAO,CACR,CAAC;AACF,SAAS,CAAC,6CAA6C,GAAG,uBAAuB,CAC/E,kDAAkD,EAClD;IACE,QAAQ,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;CACvC,EACD,aAAa,CACd,CAAC"}
1
+ {"version":3,"file":"mockapi.js","sourceRoot":"","sources":["../../../../specs/encode/duration/mockapi.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,IAAI,EAEJ,aAAa,GAEd,MAAM,oBAAoB,CAAC;AAE5B,MAAM,CAAC,MAAM,SAAS,GAAoC,EAAE,CAAC;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@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@typespec/http-specs",
3
- "version": "0.1.0-alpha.28-dev.0",
3
+ "version": "0.1.0-alpha.28-dev.2",
4
4
  "description": "Spec scenarios and mock apis",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -25,7 +25,7 @@
25
25
  "devDependencies": {
26
26
  "@types/deep-equal": "^1.0.1",
27
27
  "@types/multer": "^2.0.0",
28
- "@types/node": "~24.3.0",
28
+ "@types/node": "~24.9.1",
29
29
  "@typespec/json-schema": "^1.5.0",
30
30
  "@typespec/openapi": "^1.5.0",
31
31
  "@typespec/openapi3": "^1.5.0",
package/spec-summary.md CHANGED
@@ -538,6 +538,14 @@ Expected header `duration: 35.625`
538
538
  Test float milliseconds encode for a duration header.
539
539
  Expected header `duration: 35625`
540
540
 
541
+ ### Encode_Duration_Header_floatMillisecondsLargerUnit
542
+
543
+ - Endpoint: `get /encode/duration/header/float-milliseconds-larger-unit`
544
+
545
+ Test float milliseconds encode for a duration header where the duration is several minutes.
546
+ Languages that support duration primitives should use the largest possible unit, e.g. TimeSpan.FromMinutes(3.5) in C#.
547
+ Expected header `duration: 210000.0`
548
+
541
549
  ### Encode_Duration_Header_floatSeconds
542
550
 
543
551
  - Endpoint: `get /encode/duration/header/float-seconds`
@@ -545,6 +553,14 @@ Expected header `duration: 35625`
545
553
  Test float seconds encode for a duration header.
546
554
  Expected header `duration: 35.625`
547
555
 
556
+ ### Encode_Duration_Header_floatSecondsLargerUnit
557
+
558
+ - Endpoint: `get /encode/duration/header/float-seconds-larger-unit`
559
+
560
+ Test float seconds encode for a duration header where the duration is several minutes.
561
+ Languages that support duration primitives should use the largest possible unit, e.g. TimeSpan.FromMinutes(2.5) in C#.
562
+ Expected header `duration: 150.0`
563
+
548
564
  ### Encode_Duration_Header_int32Milliseconds
549
565
 
550
566
  - Endpoint: `get /encode/duration/header/int32-milliseconds`
@@ -559,6 +575,14 @@ Expected header `duration: 36000`
559
575
  Test int32 milliseconds encode for a duration array header.
560
576
  Expected header `duration: [36000,47000]`
561
577
 
578
+ ### Encode_Duration_Header_int32MillisecondsLargerUnit
579
+
580
+ - Endpoint: `get /encode/duration/header/int32-milliseconds-larger-unit`
581
+
582
+ Test int32 milliseconds encode for a duration header where the duration is several minutes.
583
+ Languages that support duration primitives should use the largest possible unit, e.g. TimeSpan.FromMinutes(3) in C#.
584
+ Expected header `duration: 180000`
585
+
562
586
  ### Encode_Duration_Header_int32Seconds
563
587
 
564
588
  - Endpoint: `get /encode/duration/header/int32-seconds`
@@ -566,6 +590,14 @@ Expected header `duration: [36000,47000]`
566
590
  Test int32 seconds encode for a duration header.
567
591
  Expected header `duration: 36`
568
592
 
593
+ ### Encode_Duration_Header_int32SecondsLargerUnit
594
+
595
+ - Endpoint: `get /encode/duration/header/int32-seconds-larger-unit`
596
+
597
+ Test int32 seconds encode for a duration header where the duration is several minutes.
598
+ Languages that support duration primitives should use the largest possible unit, e.g. TimeSpan.FromMinutes(2) in C#.
599
+ Expected header `duration: 120`
600
+
569
601
  ### Encode_Duration_Header_iso8601
570
602
 
571
603
  - Endpoint: `get /encode/duration/header/iso8601`
@@ -685,6 +717,28 @@ Expected response body:
685
717
  }
686
718
  ```
687
719
 
720
+ ### Encode_Duration_Property_floatMillisecondsLargerUnit
721
+
722
+ - Endpoint: `get /encode/duration/property/float-milliseconds-larger-unit`
723
+
724
+ Test operation with request and response model contains a duration property with float milliseconds encode where the duration is several minutes.
725
+ Languages that support duration primitives should use the largest possible unit, e.g. TimeSpan.FromMinutes(3.5) in C#.
726
+ Expected request body:
727
+
728
+ ```json
729
+ {
730
+ "value": 210000.0
731
+ }
732
+ ```
733
+
734
+ Expected response body:
735
+
736
+ ```json
737
+ {
738
+ "value": 210000.0
739
+ }
740
+ ```
741
+
688
742
  ### Encode_Duration_Property_floatSeconds
689
743
 
690
744
  - Endpoint: `get /encode/duration/property/float-seconds`
@@ -727,6 +781,28 @@ Expected response body:
727
781
  }
728
782
  ```
729
783
 
784
+ ### Encode_Duration_Property_floatSecondsLargerUnit
785
+
786
+ - Endpoint: `get /encode/duration/property/float-seconds-larger-unit`
787
+
788
+ Test operation with request and response model contains a duration property with float seconds encode where the duration is several minutes.
789
+ Languages that support duration primitives should use the largest possible unit, e.g. TimeSpan.FromMinutes(2.5) in C#.
790
+ Expected request body:
791
+
792
+ ```json
793
+ {
794
+ "value": 150.0
795
+ }
796
+ ```
797
+
798
+ Expected response body:
799
+
800
+ ```json
801
+ {
802
+ "value": 150.0
803
+ }
804
+ ```
805
+
730
806
  ### Encode_Duration_Property_int32Milliseconds
731
807
 
732
808
  - Endpoint: `get /encode/duration/property/int32-milliseconds`
@@ -748,6 +824,28 @@ Expected response body:
748
824
  }
749
825
  ```
750
826
 
827
+ ### Encode_Duration_Property_int32MillisecondsLargerUnit
828
+
829
+ - Endpoint: `get /encode/duration/property/int32-milliseconds-larger-unit`
830
+
831
+ Test operation with request and response model contains a duration property with int32 milliseconds encode where the duration is several minutes.
832
+ Languages that support duration primitives should use the largest possible unit, e.g. TimeSpan.FromMinutes(3) in C#.
833
+ Expected request body:
834
+
835
+ ```json
836
+ {
837
+ "value": 180000
838
+ }
839
+ ```
840
+
841
+ Expected response body:
842
+
843
+ ```json
844
+ {
845
+ "value": 180000
846
+ }
847
+ ```
848
+
751
849
  ### Encode_Duration_Property_int32Seconds
752
850
 
753
851
  - Endpoint: `get /encode/duration/property/int32-seconds`
@@ -769,6 +867,28 @@ Expected response body:
769
867
  }
770
868
  ```
771
869
 
870
+ ### Encode_Duration_Property_int32SecondsLargerUnit
871
+
872
+ - Endpoint: `get /encode/duration/property/int32-seconds-larger-unit`
873
+
874
+ Test operation with request and response model contains a duration property with int32 seconds encode where the duration is several minutes.
875
+ Languages that support duration primitives should use the largest possible unit, e.g. TimeSpan.FromMinutes(2) in C#.
876
+ Expected request body:
877
+
878
+ ```json
879
+ {
880
+ "value": 120
881
+ }
882
+ ```
883
+
884
+ Expected response body:
885
+
886
+ ```json
887
+ {
888
+ "value": 120
889
+ }
890
+ ```
891
+
772
892
  ### Encode_Duration_Property_iso8601
773
893
 
774
894
  - Endpoint: `post /encode/duration/property/iso8601`
@@ -818,6 +938,14 @@ Expected query parameter `input=35.625`
818
938
  Test float milliseconds encode for a duration parameter.
819
939
  Expected query parameter `input=35625`
820
940
 
941
+ ### Encode_Duration_Query_floatMillisecondsLargerUnit
942
+
943
+ - Endpoint: `get /encode/duration/query/float-milliseconds-larger-unit`
944
+
945
+ Test float milliseconds encode for a duration parameter where the duration is several minutes.
946
+ Languages that support duration primitives should use the largest possible unit, e.g. TimeSpan.FromMinutes(3.5) in C#.
947
+ Expected query parameter `input=210000.0`
948
+
821
949
  ### Encode_Duration_Query_floatSeconds
822
950
 
823
951
  - Endpoint: `get /encode/duration/query/float-seconds`
@@ -825,6 +953,14 @@ Expected query parameter `input=35625`
825
953
  Test float seconds encode for a duration parameter.
826
954
  Expected query parameter `input=35.625`
827
955
 
956
+ ### Encode_Duration_Query_floatSecondsLargerUnit
957
+
958
+ - Endpoint: `get /encode/duration/query/float-seconds-larger-unit`
959
+
960
+ Test float seconds encode for a duration parameter where the duration is several minutes.
961
+ Languages that support duration primitives should use the largest possible unit, e.g. TimeSpan.FromMinutes(2.5) in C#.
962
+ Expected query parameter `input=150.0`
963
+
828
964
  ### Encode_Duration_Query_int32Milliseconds
829
965
 
830
966
  - Endpoint: `get /encode/duration/query/int32-milliseconds`
@@ -839,6 +975,14 @@ Expected query parameter `input=36000`
839
975
  Test int32 milliseconds encode for a duration array parameter.
840
976
  Expected query parameter `input=36000,47000`
841
977
 
978
+ ### Encode_Duration_Query_int32MillisecondsLargerUnit
979
+
980
+ - Endpoint: `get /encode/duration/query/int32-milliseconds-larger-unit`
981
+
982
+ Test int32 milliseconds encode for a duration parameter where the duration is several minutes.
983
+ Languages that support duration primitives should use the largest possible unit, e.g. TimeSpan.FromMinutes(3) in C#.
984
+ Expected query parameter `input=180000`
985
+
842
986
  ### Encode_Duration_Query_int32Seconds
843
987
 
844
988
  - Endpoint: `get /encode/duration/query/int32-seconds`
@@ -853,6 +997,14 @@ Expected query parameter `input=36`
853
997
  Test int32 seconds encode for a duration array parameter.
854
998
  Expected query parameter `input=36,47`
855
999
 
1000
+ ### Encode_Duration_Query_int32SecondsLargerUnit
1001
+
1002
+ - Endpoint: `get /encode/duration/query/int32-seconds-larger-unit`
1003
+
1004
+ Test int32 seconds encode for a duration parameter where the duration is several minutes.
1005
+ Languages that support duration primitives should use the largest possible unit, e.g. TimeSpan.FromMinutes(2) in C#.
1006
+ Expected query parameter `input=120`
1007
+
856
1008
  ### Encode_Duration_Query_iso8601
857
1009
 
858
1010
  - Endpoint: `get /encode/duration/query/iso8601`
@@ -45,6 +45,19 @@ namespace Query {
45
45
  input: duration,
46
46
  ): NoContentResponse;
47
47
 
48
+ @route("/int32-seconds-larger-unit")
49
+ @scenario
50
+ @scenarioDoc("""
51
+ Test int32 seconds encode for a duration parameter where the duration is several minutes.
52
+ Languages that support duration primitives should use the largest possible unit, e.g. TimeSpan.FromMinutes(2) in C#.
53
+ Expected query parameter `input=120`
54
+ """)
55
+ op int32SecondsLargerUnit(
56
+ @query
57
+ @encode(DurationKnownEncoding.seconds, int32)
58
+ input: duration,
59
+ ): NoContentResponse;
60
+
48
61
  @route("/float-seconds")
49
62
  @scenario
50
63
  @scenarioDoc("""
@@ -57,6 +70,19 @@ namespace Query {
57
70
  input: duration,
58
71
  ): NoContentResponse;
59
72
 
73
+ @route("/float-seconds-larger-unit")
74
+ @scenario
75
+ @scenarioDoc("""
76
+ Test float seconds encode for a duration parameter where the duration is several minutes.
77
+ Languages that support duration primitives should use the largest possible unit, e.g. TimeSpan.FromMinutes(2.5) in C#.
78
+ Expected query parameter `input=150.0`
79
+ """)
80
+ op floatSecondsLargerUnit(
81
+ @query
82
+ @encode(DurationKnownEncoding.seconds, float)
83
+ input: duration,
84
+ ): NoContentResponse;
85
+
60
86
  @route("/float64-seconds")
61
87
  @scenario
62
88
  @scenarioDoc("""
@@ -81,6 +107,19 @@ namespace Query {
81
107
  input: duration,
82
108
  ): NoContentResponse;
83
109
 
110
+ @route("/int32-milliseconds-larger-unit")
111
+ @scenario
112
+ @scenarioDoc("""
113
+ Test int32 milliseconds encode for a duration parameter where the duration is several minutes.
114
+ Languages that support duration primitives should use the largest possible unit, e.g. TimeSpan.FromMinutes(3) in C#.
115
+ Expected query parameter `input=180000`
116
+ """)
117
+ op int32MillisecondsLargerUnit(
118
+ @query
119
+ @encode(DurationKnownEncoding.milliseconds, int32)
120
+ input: duration,
121
+ ): NoContentResponse;
122
+
84
123
  @route("/float-milliseconds")
85
124
  @scenario
86
125
  @scenarioDoc("""
@@ -93,6 +132,19 @@ namespace Query {
93
132
  input: duration,
94
133
  ): NoContentResponse;
95
134
 
135
+ @route("/float-milliseconds-larger-unit")
136
+ @scenario
137
+ @scenarioDoc("""
138
+ Test float milliseconds encode for a duration parameter where the duration is several minutes.
139
+ Languages that support duration primitives should use the largest possible unit, e.g. TimeSpan.FromMinutes(3.5) in C#.
140
+ Expected query parameter `input=210000.0`
141
+ """)
142
+ op floatMillisecondsLargerUnit(
143
+ @query
144
+ @encode(DurationKnownEncoding.milliseconds, float)
145
+ input: duration,
146
+ ): NoContentResponse;
147
+
96
148
  @route("/float64-milliseconds")
97
149
  @scenario
98
150
  @scenarioDoc("""
@@ -175,6 +227,26 @@ namespace Property {
175
227
  value: duration;
176
228
  }
177
229
 
230
+ model Int32SecondsLargerUnitDurationProperty {
231
+ @encode(DurationKnownEncoding.seconds, int32)
232
+ value: duration;
233
+ }
234
+
235
+ model FloatSecondsLargerUnitDurationProperty {
236
+ @encode(DurationKnownEncoding.seconds, float)
237
+ value: duration;
238
+ }
239
+
240
+ model Int32MillisecondsLargerUnitDurationProperty {
241
+ @encode(DurationKnownEncoding.milliseconds, int32)
242
+ value: duration;
243
+ }
244
+
245
+ model FloatMillisecondsLargerUnitDurationProperty {
246
+ @encode(DurationKnownEncoding.milliseconds, float)
247
+ value: duration;
248
+ }
249
+
178
250
  @encode(DurationKnownEncoding.seconds, float32)
179
251
  scalar Float32Duration extends duration;
180
252
 
@@ -390,6 +462,94 @@ namespace Property {
390
462
  op floatMillisecondsArray(
391
463
  @body body: FloatMillisecondsDurationArrayProperty,
392
464
  ): FloatMillisecondsDurationArrayProperty;
465
+
466
+ @route("/int32-seconds-larger-unit")
467
+ @scenario
468
+ @scenarioDoc("""
469
+ Test operation with request and response model contains a duration property with int32 seconds encode where the duration is several minutes.
470
+ Languages that support duration primitives should use the largest possible unit, e.g. TimeSpan.FromMinutes(2) in C#.
471
+ Expected request body:
472
+ ```json
473
+ {
474
+ "value": 120
475
+ }
476
+ ```
477
+ Expected response body:
478
+ ```json
479
+ {
480
+ "value": 120
481
+ }
482
+ ```
483
+ """)
484
+ op int32SecondsLargerUnit(
485
+ @body body: Int32SecondsLargerUnitDurationProperty,
486
+ ): Int32SecondsLargerUnitDurationProperty;
487
+
488
+ @route("/float-seconds-larger-unit")
489
+ @scenario
490
+ @scenarioDoc("""
491
+ Test operation with request and response model contains a duration property with float seconds encode where the duration is several minutes.
492
+ Languages that support duration primitives should use the largest possible unit, e.g. TimeSpan.FromMinutes(2.5) in C#.
493
+ Expected request body:
494
+ ```json
495
+ {
496
+ "value": 150.0
497
+ }
498
+ ```
499
+ Expected response body:
500
+ ```json
501
+ {
502
+ "value": 150.0
503
+ }
504
+ ```
505
+ """)
506
+ op floatSecondsLargerUnit(
507
+ @body body: FloatSecondsLargerUnitDurationProperty,
508
+ ): FloatSecondsLargerUnitDurationProperty;
509
+
510
+ @route("/int32-milliseconds-larger-unit")
511
+ @scenario
512
+ @scenarioDoc("""
513
+ Test operation with request and response model contains a duration property with int32 milliseconds encode where the duration is several minutes.
514
+ Languages that support duration primitives should use the largest possible unit, e.g. TimeSpan.FromMinutes(3) in C#.
515
+ Expected request body:
516
+ ```json
517
+ {
518
+ "value": 180000
519
+ }
520
+ ```
521
+ Expected response body:
522
+ ```json
523
+ {
524
+ "value": 180000
525
+ }
526
+ ```
527
+ """)
528
+ op int32MillisecondsLargerUnit(
529
+ @body body: Int32MillisecondsLargerUnitDurationProperty,
530
+ ): Int32MillisecondsLargerUnitDurationProperty;
531
+
532
+ @route("/float-milliseconds-larger-unit")
533
+ @scenario
534
+ @scenarioDoc("""
535
+ Test operation with request and response model contains a duration property with float milliseconds encode where the duration is several minutes.
536
+ Languages that support duration primitives should use the largest possible unit, e.g. TimeSpan.FromMinutes(3.5) in C#.
537
+ Expected request body:
538
+ ```json
539
+ {
540
+ "value": 210000.0
541
+ }
542
+ ```
543
+ Expected response body:
544
+ ```json
545
+ {
546
+ "value": 210000.0
547
+ }
548
+ ```
549
+ """)
550
+ op floatMillisecondsLargerUnit(
551
+ @body body: FloatMillisecondsLargerUnitDurationProperty,
552
+ ): FloatMillisecondsLargerUnitDurationProperty;
393
553
  }
394
554
 
395
555
  @route("/header")
@@ -443,6 +603,19 @@ namespace Header {
443
603
  duration: duration,
444
604
  ): NoContentResponse;
445
605
 
606
+ @route("/int32-seconds-larger-unit")
607
+ @scenario
608
+ @scenarioDoc("""
609
+ Test int32 seconds encode for a duration header where the duration is several minutes.
610
+ Languages that support duration primitives should use the largest possible unit, e.g. TimeSpan.FromMinutes(2) in C#.
611
+ Expected header `duration: 120`
612
+ """)
613
+ op int32SecondsLargerUnit(
614
+ @header
615
+ @encode(DurationKnownEncoding.seconds, int32)
616
+ duration: duration,
617
+ ): NoContentResponse;
618
+
446
619
  @route("/float-seconds")
447
620
  @scenario
448
621
  @scenarioDoc("""
@@ -455,6 +628,19 @@ namespace Header {
455
628
  duration: duration,
456
629
  ): NoContentResponse;
457
630
 
631
+ @route("/float-seconds-larger-unit")
632
+ @scenario
633
+ @scenarioDoc("""
634
+ Test float seconds encode for a duration header where the duration is several minutes.
635
+ Languages that support duration primitives should use the largest possible unit, e.g. TimeSpan.FromMinutes(2.5) in C#.
636
+ Expected header `duration: 150.0`
637
+ """)
638
+ op floatSecondsLargerUnit(
639
+ @header
640
+ @encode(DurationKnownEncoding.seconds, float)
641
+ duration: duration,
642
+ ): NoContentResponse;
643
+
458
644
  @route("/float64-seconds")
459
645
  @scenario
460
646
  @scenarioDoc("""
@@ -479,6 +665,19 @@ namespace Header {
479
665
  duration: duration,
480
666
  ): NoContentResponse;
481
667
 
668
+ @route("/int32-milliseconds-larger-unit")
669
+ @scenario
670
+ @scenarioDoc("""
671
+ Test int32 milliseconds encode for a duration header where the duration is several minutes.
672
+ Languages that support duration primitives should use the largest possible unit, e.g. TimeSpan.FromMinutes(3) in C#.
673
+ Expected header `duration: 180000`
674
+ """)
675
+ op int32MillisecondsLargerUnit(
676
+ @header
677
+ @encode(DurationKnownEncoding.milliseconds, int32)
678
+ duration: duration,
679
+ ): NoContentResponse;
680
+
482
681
  @route("/float-milliseconds")
483
682
  @scenario
484
683
  @scenarioDoc("""
@@ -491,6 +690,19 @@ namespace Header {
491
690
  duration: duration,
492
691
  ): NoContentResponse;
493
692
 
693
+ @route("/float-milliseconds-larger-unit")
694
+ @scenario
695
+ @scenarioDoc("""
696
+ Test float milliseconds encode for a duration header where the duration is several minutes.
697
+ Languages that support duration primitives should use the largest possible unit, e.g. TimeSpan.FromMinutes(3.5) in C#.
698
+ Expected header `duration: 210000.0`
699
+ """)
700
+ op floatMillisecondsLargerUnit(
701
+ @header
702
+ @encode(DurationKnownEncoding.milliseconds, float)
703
+ duration: duration,
704
+ ): NoContentResponse;
705
+
494
706
  @route("/float64-milliseconds")
495
707
  @scenario
496
708
  @scenarioDoc("""