@autorest/java 4.1.24 → 4.1.26
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.
- package/androidgen/README.md +59 -15
- package/androidgen/target/azure-autorest-androidgen-jar-with-dependencies.jar +0 -0
- package/fluentgen/package.json +2 -2
- package/fluentgen/readme.md +60 -2
- package/fluentgen/target/azure-autorest-fluentgen-jar-with-dependencies.jar +0 -0
- package/javagen/data-plane.md +23 -0
- package/javagen/readme.md +54 -9
- package/javagen/target/azure-autorest-javagen-jar-with-dependencies.jar +0 -0
- package/package.json +2 -2
- package/readme.md +3 -1
- package/typespec-extension/package.json +26 -18
- package/typespec-extension/readme.md +6 -6
- package/typespec-tests/package.json +13 -14
- package/typespec-tests/readme.md +35 -8
- package/fluentnamer/package.json +0 -26
- package/fluentnamer/readme.md +0 -67
- package/fluentnamer/target/azure-autorest-fluentnamer-jar-with-dependencies.jar +0 -0
- package/postprocessor/package.json +0 -26
- package/postprocessor/readme.md +0 -9
- package/postprocessor/target/azure-autorest-postprocessor-jar-with-dependencies.jar +0 -0
- package/preprocessor/package.json +0 -26
- package/preprocessor/readme.md +0 -62
- package/preprocessor/target/azure-autorest-preprocessor-jar-with-dependencies.jar +0 -0
- /package/{preprocessor → androidgen}/data-plane.md +0 -0
package/androidgen/README.md
CHANGED
|
@@ -1,30 +1,74 @@
|
|
|
1
1
|
#### Androidgen
|
|
2
2
|
|
|
3
3
|
``` yaml
|
|
4
|
-
|
|
5
|
-
-
|
|
6
|
-
-
|
|
7
|
-
|
|
4
|
+
pass-thru:
|
|
5
|
+
- model-deduplicator
|
|
6
|
+
- subset-reducer
|
|
7
|
+
|
|
8
|
+
use-extension:
|
|
9
|
+
"@autorest/modelerfour": "4.26.2"
|
|
10
|
+
|
|
8
11
|
pipeline:
|
|
9
12
|
|
|
10
13
|
# --- extension remodeler ---
|
|
14
|
+
|
|
15
|
+
# "Shake the tree", and normalize the model
|
|
16
|
+
modelerfour:
|
|
17
|
+
input: openapi-document/multi-api/identity # the plugin where we get inputs from
|
|
18
|
+
|
|
19
|
+
# allow developer to do transformations on the code model.
|
|
20
|
+
modelerfour/new-transform:
|
|
21
|
+
input: modelerfour
|
|
22
|
+
|
|
11
23
|
androidgen:
|
|
12
24
|
scope: android
|
|
13
|
-
input:
|
|
14
|
-
output-artifact: java-files
|
|
15
|
-
|
|
16
|
-
postprocessor:
|
|
17
|
-
input: androidgen
|
|
25
|
+
input: modelerfour/identity
|
|
18
26
|
output-artifact: java-files
|
|
19
27
|
|
|
20
|
-
|
|
21
|
-
input:
|
|
22
|
-
scope: scope-
|
|
23
|
-
|
|
24
|
-
scope-
|
|
28
|
+
androidgen/emitter:
|
|
29
|
+
input: androidgen
|
|
30
|
+
scope: scope-androidgen/emitter
|
|
31
|
+
|
|
32
|
+
scope-androidgen/emitter:
|
|
25
33
|
input-artifact: java-files
|
|
26
34
|
output-uri-expr: $key
|
|
27
35
|
|
|
28
36
|
output-artifact: java-files
|
|
29
37
|
|
|
30
|
-
|
|
38
|
+
modelerfour:
|
|
39
|
+
seal-single-value-enum-by-default: true
|
|
40
|
+
|
|
41
|
+
skip-special-headers:
|
|
42
|
+
- Repeatability-Request-ID
|
|
43
|
+
- Repeatability-First-Sent
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
```yaml !$(data-plane)
|
|
47
|
+
modelerfour:
|
|
48
|
+
flatten-models: true
|
|
49
|
+
flatten-payloads: true
|
|
50
|
+
group-parameters: true
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
```yaml $(data-plane)
|
|
54
|
+
modelerfour:
|
|
55
|
+
flatten-models: false
|
|
56
|
+
flatten-payloads: false
|
|
57
|
+
group-parameters: false
|
|
58
|
+
|
|
59
|
+
lenient-model-deduplication: true
|
|
60
|
+
|
|
61
|
+
naming:
|
|
62
|
+
choiceValue: upper
|
|
63
|
+
preserve-uppercase-max-length: 2
|
|
64
|
+
override:
|
|
65
|
+
ip: Ip
|
|
66
|
+
id: Id
|
|
67
|
+
|
|
68
|
+
require:
|
|
69
|
+
- $(this-folder)data-plane.md
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
```yaml $(data-plane) && $(sdk-integration)
|
|
73
|
+
regenerate-pom: true
|
|
74
|
+
```
|
|
Binary file
|
package/fluentgen/package.json
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
"description": "The Java extension for classic generators in AutoRest.",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"autorest": "autorest",
|
|
7
|
-
"start": "java
|
|
8
|
-
"debug": "java
|
|
7
|
+
"start": "java -jar target/azure-autorest-fluentgen-jar-with-dependencies.jar",
|
|
8
|
+
"debug": "java -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,quiet=y,address=5005 -jar target/azure-autorest-fluentgen-jar-with-dependencies.jar",
|
|
9
9
|
"build": "mvn package -P local"
|
|
10
10
|
},
|
|
11
11
|
"repository": {
|
package/fluentgen/readme.md
CHANGED
|
@@ -1,12 +1,41 @@
|
|
|
1
1
|
#### Fluentgen
|
|
2
2
|
|
|
3
3
|
``` yaml
|
|
4
|
-
|
|
4
|
+
pass-thru:
|
|
5
|
+
- model-deduplicator
|
|
6
|
+
- subset-reducer
|
|
7
|
+
|
|
8
|
+
use-extension:
|
|
9
|
+
"@autorest/modelerfour": "4.26.2"
|
|
10
|
+
|
|
5
11
|
pipeline:
|
|
6
12
|
|
|
13
|
+
# --- extension remodeler ---
|
|
14
|
+
|
|
15
|
+
# "Shake the tree", and normalize the model
|
|
16
|
+
modelerfour:
|
|
17
|
+
input: openapi-document/multi-api/identity # the plugin where we get inputs from
|
|
18
|
+
|
|
19
|
+
# allow developer to do transformations on the code model.
|
|
20
|
+
modelerfour/new-transform:
|
|
21
|
+
input: modelerfour
|
|
22
|
+
|
|
7
23
|
fluentgen:
|
|
8
24
|
scope: java
|
|
9
|
-
input:
|
|
25
|
+
input: modelerfour/identity
|
|
26
|
+
naming:
|
|
27
|
+
override:
|
|
28
|
+
eTag: etag
|
|
29
|
+
userName: username
|
|
30
|
+
metaData: metadata
|
|
31
|
+
timeStamp: timestamp
|
|
32
|
+
hostName: hostname
|
|
33
|
+
webHook: webhook
|
|
34
|
+
coolDown: cooldown
|
|
35
|
+
resourceregion: resourceRegion
|
|
36
|
+
sTag: stag
|
|
37
|
+
tagname: tagName
|
|
38
|
+
tagvalue: tagValue
|
|
10
39
|
output-artifact: java-files
|
|
11
40
|
|
|
12
41
|
fluentgen/emitter:
|
|
@@ -18,4 +47,33 @@ scope-fluentgen/emitter:
|
|
|
18
47
|
output-uri-expr: $key
|
|
19
48
|
|
|
20
49
|
output-artifact: java-files
|
|
50
|
+
|
|
51
|
+
modelerfour:
|
|
52
|
+
flatten-models: false
|
|
53
|
+
flatten-payloads: false
|
|
54
|
+
|
|
55
|
+
additional-checks: true
|
|
56
|
+
lenient-model-deduplication: false
|
|
57
|
+
remove-empty-child-schemas: false
|
|
58
|
+
seal-single-value-enum-by-default: true
|
|
59
|
+
|
|
60
|
+
naming:
|
|
61
|
+
choiceValue: upper
|
|
62
|
+
preserve-uppercase-max-length: 2
|
|
63
|
+
override:
|
|
64
|
+
ip: Ip
|
|
65
|
+
id: Id
|
|
66
|
+
|
|
67
|
+
include-x-ms-examples-original-file: true
|
|
68
|
+
|
|
69
|
+
license-header: MICROSOFT_MIT_SMALL
|
|
70
|
+
regenerate-pom: true
|
|
71
|
+
sync-methods: all
|
|
72
|
+
client-side-validations: true
|
|
73
|
+
client-logger: true
|
|
74
|
+
generate-client-interfaces: true
|
|
75
|
+
required-parameter-client-methods: true
|
|
76
|
+
client-flattened-annotation-target: none
|
|
77
|
+
null-byte-array-maps-to-empty-array: true
|
|
78
|
+
graal-vm-config: true
|
|
21
79
|
```
|
|
Binary file
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
#### data-plane
|
|
2
|
+
|
|
3
|
+
```yaml
|
|
4
|
+
azure-arm: false
|
|
5
|
+
|
|
6
|
+
license-header: MICROSOFT_MIT_SMALL
|
|
7
|
+
|
|
8
|
+
generate-client-interfaces: false
|
|
9
|
+
generate-client-as-impl: true
|
|
10
|
+
generate-sync-async-clients: true
|
|
11
|
+
generate-builder-per-client: true
|
|
12
|
+
sync-methods: all
|
|
13
|
+
enable-sync-stack: true
|
|
14
|
+
required-fields-as-ctor-args: true
|
|
15
|
+
enable-page-size: true
|
|
16
|
+
use-key-credential: true
|
|
17
|
+
|
|
18
|
+
use-default-http-status-code-to-exception-type-mapping: true
|
|
19
|
+
polling: {}
|
|
20
|
+
|
|
21
|
+
models-subpackage: implementation.models
|
|
22
|
+
client-logger: true
|
|
23
|
+
```
|
package/javagen/readme.md
CHANGED
|
@@ -1,24 +1,32 @@
|
|
|
1
1
|
#### Javagen
|
|
2
2
|
|
|
3
3
|
``` yaml
|
|
4
|
-
|
|
5
|
-
-
|
|
6
|
-
-
|
|
4
|
+
pass-thru:
|
|
5
|
+
- model-deduplicator
|
|
6
|
+
- subset-reducer
|
|
7
|
+
|
|
8
|
+
use-extension:
|
|
9
|
+
"@autorest/modelerfour": "4.26.2"
|
|
7
10
|
|
|
8
11
|
pipeline:
|
|
9
12
|
|
|
10
13
|
# --- extension remodeler ---
|
|
14
|
+
|
|
15
|
+
# "Shake the tree", and normalize the model
|
|
16
|
+
modelerfour:
|
|
17
|
+
input: openapi-document/multi-api/identity # the plugin where we get inputs from
|
|
18
|
+
|
|
19
|
+
# allow developer to do transformations on the code model.
|
|
20
|
+
modelerfour/new-transform:
|
|
21
|
+
input: modelerfour
|
|
22
|
+
|
|
11
23
|
javagen:
|
|
12
24
|
scope: java
|
|
13
|
-
input:
|
|
25
|
+
input: modelerfour/identity
|
|
14
26
|
output-artifact: java-files
|
|
15
27
|
|
|
16
|
-
|
|
28
|
+
javagen/emitter:
|
|
17
29
|
input: javagen
|
|
18
|
-
output-artifact: java-files
|
|
19
|
-
|
|
20
|
-
postprocess/emitter:
|
|
21
|
-
input: postprocessor
|
|
22
30
|
scope: scope-javagen/emitter
|
|
23
31
|
|
|
24
32
|
scope-javagen/emitter:
|
|
@@ -26,4 +34,41 @@ scope-javagen/emitter:
|
|
|
26
34
|
output-uri-expr: $key
|
|
27
35
|
|
|
28
36
|
output-artifact: java-files
|
|
37
|
+
|
|
38
|
+
modelerfour:
|
|
39
|
+
seal-single-value-enum-by-default: true
|
|
40
|
+
|
|
41
|
+
skip-special-headers:
|
|
42
|
+
- Repeatability-Request-ID
|
|
43
|
+
- Repeatability-First-Sent
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
```yaml !$(data-plane)
|
|
47
|
+
modelerfour:
|
|
48
|
+
flatten-models: true
|
|
49
|
+
flatten-payloads: true
|
|
50
|
+
group-parameters: true
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
```yaml $(data-plane)
|
|
54
|
+
modelerfour:
|
|
55
|
+
flatten-models: false
|
|
56
|
+
flatten-payloads: false
|
|
57
|
+
group-parameters: false
|
|
58
|
+
|
|
59
|
+
lenient-model-deduplication: true
|
|
60
|
+
|
|
61
|
+
naming:
|
|
62
|
+
choiceValue: upper
|
|
63
|
+
preserve-uppercase-max-length: 2
|
|
64
|
+
override:
|
|
65
|
+
ip: Ip
|
|
66
|
+
id: Id
|
|
67
|
+
|
|
68
|
+
require:
|
|
69
|
+
- $(this-folder)data-plane.md
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
```yaml $(data-plane) && $(sdk-integration)
|
|
73
|
+
regenerate-pom: true
|
|
29
74
|
```
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@autorest/java",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.26",
|
|
4
4
|
"description": "The Java extension for classic generators in AutoRest.",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"autorest": "autorest",
|
|
@@ -40,6 +40,6 @@
|
|
|
40
40
|
],
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"autorest": "^3.0.0",
|
|
43
|
-
"@microsoft.azure/autorest.testserver": "3.3.
|
|
43
|
+
"@microsoft.azure/autorest.testserver": "3.3.48"
|
|
44
44
|
}
|
|
45
45
|
}
|
package/readme.md
CHANGED
|
@@ -152,6 +152,7 @@ Polling configurations can be set through `--polling` setting globally or for ea
|
|
|
152
152
|
polling:
|
|
153
153
|
{operationId}:
|
|
154
154
|
strategy: {strategy}
|
|
155
|
+
sync-strategy: {sync-strategy}
|
|
155
156
|
intermediate-type: {intermediate-type}
|
|
156
157
|
final-type: {final-type}
|
|
157
158
|
poll-interval: {poll-interval}
|
|
@@ -162,7 +163,8 @@ With the fields specified below:
|
|
|
162
163
|
|Field|Type|Required|Description|Example|
|
|
163
164
|
|-----|----|--------|-----------|-------|
|
|
164
165
|
|operationId|String|true|The `operationId` of the operation. For global polling configuration, use `default`. Case insensitive.|`Pets_put`|
|
|
165
|
-
|strategy|String|false|The invocation to construct a polling strategy. Use fully qualified class name if outside the implementation subpackage specified in `namespace` & `implementation-subpackage`. Use dynamic literals `{httpPipeline}`, `{context}`, `{serializerAdapter}`, `{intermediate-type}`, `{final-type}` if these components are required to construct the polling strategy. Default is `new DefaultPollingStrategy<>(new PollingStrategyOptions({httpPipeline}).setEndpoint({endpoint}).setContext({context}))`.|`new com.azure.core.util.polling.OperationResourcePollingStrategy<>({httpPipeline}, {context})`|
|
|
166
|
+
|strategy|String|false|The invocation to construct a polling strategy. Use fully qualified class name if outside the implementation subpackage specified in `namespace` & `implementation-subpackage`. Use dynamic literals `{httpPipeline}`, `{context}`, `{serializerAdapter}`, `{endpoint}`, `{serviceVersion}`, `{intermediate-type}`, `{final-type}` if these components are required to construct the polling strategy. Default is `new DefaultPollingStrategy<>(new PollingStrategyOptions({httpPipeline}).setEndpoint({endpoint}).setContext({context}).setServiceVersion({serviceVersion}))`.|`new com.azure.core.util.polling.OperationResourcePollingStrategy<>({httpPipeline}, {context})`|
|
|
167
|
+
|sync-stragety|String|false|Similar to `stragety`. It refers to the synchronous operation resource polling strategy.||
|
|
166
168
|
|intermediate-type|String|false|The type of the polling intermediate type. Use fully qualified class name if outside the base package specified in `namespace`. Default is the return type specified on the operation in Swagger, or `BinaryData` if the operation returns `void`.|`PollResult`,`com.azure.core.util.BinaryData`|
|
|
167
169
|
|final-type|String|false|The type of the final result type. Use fully qualified class name if outside the base package specified in `namespace`. Default is the return type specified on the operation in Swagger, or `BinaryData` if the operation returns `void`.|`Pet`,`com.azure.core.util.BinaryData`|
|
|
168
170
|
|poll-interval|integer|false|The default interval in seconds to poll with (can be modified by users in `PollerFlux` and `SyncPoller`. Default is 1.|30|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@azure-tools/typespec-java",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.2",
|
|
4
4
|
"description": "TypeSpec library for emitting Java client from the TypeSpec REST protocol binding",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"TypeSpec"
|
|
@@ -42,34 +42,42 @@
|
|
|
42
42
|
"lib/*.tsp",
|
|
43
43
|
"dist/**",
|
|
44
44
|
"!dist/test/**",
|
|
45
|
-
"target/
|
|
45
|
+
"target/emitter.jar"
|
|
46
46
|
],
|
|
47
47
|
"peerDependencies": {
|
|
48
|
-
"@typespec/compiler": ">=0.
|
|
49
|
-
"@typespec/
|
|
50
|
-
"@typespec/
|
|
51
|
-
"@typespec/
|
|
52
|
-
"@
|
|
53
|
-
"@azure-tools/typespec-
|
|
48
|
+
"@typespec/compiler": ">=0.51.0 <1.0.0",
|
|
49
|
+
"@typespec/http": ">=0.51.0 <1.0.0",
|
|
50
|
+
"@typespec/rest": ">=0.51.0 <1.0.0",
|
|
51
|
+
"@typespec/openapi": ">=0.51.0 <1.0.0",
|
|
52
|
+
"@typespec/versioning": ">=0.51.0 <1.0.0",
|
|
53
|
+
"@azure-tools/typespec-azure-core": ">=0.37.2 <1.0.0",
|
|
54
|
+
"@azure-tools/typespec-client-generator-core": ">=0.37.0 <1.0.0"
|
|
54
55
|
},
|
|
55
56
|
"dependencies": {
|
|
56
|
-
"@autorest/codemodel": "~4.
|
|
57
|
+
"@autorest/codemodel": "~4.20.0",
|
|
57
58
|
"lodash": "~4.17.21",
|
|
58
59
|
"js-yaml": "~4.1.0"
|
|
59
60
|
},
|
|
60
61
|
"devDependencies": {
|
|
61
|
-
"
|
|
62
|
+
"prettier": "~3.1.0",
|
|
63
|
+
"@types/lodash": "~4.14.202",
|
|
62
64
|
"@types/js-yaml": "~4.0.9",
|
|
63
|
-
"@types/mocha": "~10.0.
|
|
64
|
-
"@types/node": "~20.
|
|
65
|
-
"@types/prettier": "~2.7.3",
|
|
65
|
+
"@types/mocha": "~10.0.6",
|
|
66
|
+
"@types/node": "~20.10.3",
|
|
66
67
|
"c8": "~8.0.1",
|
|
67
|
-
"eslint": "~8.
|
|
68
|
+
"eslint": "~8.55.0",
|
|
68
69
|
"mocha": "~10.2.0",
|
|
69
70
|
"rimraf": "~5.0.5",
|
|
70
|
-
"typescript": "~5.
|
|
71
|
-
"@typescript-eslint/parser": "~6.
|
|
72
|
-
"@typescript-eslint/eslint-plugin": "~6.
|
|
73
|
-
"eslint-plugin-deprecation": "~2.0.0"
|
|
71
|
+
"typescript": "~5.3.3",
|
|
72
|
+
"@typescript-eslint/parser": "~6.13.2",
|
|
73
|
+
"@typescript-eslint/eslint-plugin": "~6.13.2",
|
|
74
|
+
"eslint-plugin-deprecation": "~2.0.0",
|
|
75
|
+
"@azure-tools/typespec-azure-core": "0.37.2",
|
|
76
|
+
"@azure-tools/typespec-client-generator-core": "0.37.0",
|
|
77
|
+
"@typespec/compiler": "0.51.0",
|
|
78
|
+
"@typespec/http": "0.51.0",
|
|
79
|
+
"@typespec/openapi": "0.51.0",
|
|
80
|
+
"@typespec/rest": "0.51.0",
|
|
81
|
+
"@typespec/versioning": "0.51.0"
|
|
74
82
|
}
|
|
75
83
|
}
|
|
@@ -4,7 +4,7 @@ Install [Node.js](https://nodejs.org/en/download/) 16 or above. (Verify by `node
|
|
|
4
4
|
|
|
5
5
|
Install [Java](https://docs.microsoft.com/java/openjdk/download) 11 or above. (Verify by `java --version`)
|
|
6
6
|
|
|
7
|
-
Install [TypeSpec](https://github.com/microsoft/typespec/) 0.
|
|
7
|
+
Install [TypeSpec](https://github.com/microsoft/typespec/) 0.51.
|
|
8
8
|
|
|
9
9
|
# Initialize TypeSpec Project
|
|
10
10
|
|
|
@@ -54,13 +54,15 @@ options:
|
|
|
54
54
|
emitter-output-dir: "{project-root}/azure-ai-language-authoring"
|
|
55
55
|
namespace: "com.azure.ai.language.authoring"
|
|
56
56
|
service-name: "Authoring"
|
|
57
|
-
partial-update: false
|
|
58
57
|
service-versions:
|
|
59
58
|
- "2022-05-15-preview"
|
|
60
|
-
|
|
59
|
+
enable-sync-stack: true
|
|
60
|
+
stream-style-serialization: false
|
|
61
61
|
generate-samples: true
|
|
62
62
|
generate-tests: true
|
|
63
63
|
examples-directory: "./examples"
|
|
64
|
+
partial-update: false
|
|
65
|
+
models-subpackage: "models"
|
|
64
66
|
custom-types-subpackage: "implementation.models"
|
|
65
67
|
custom-types: InternalModel1,InternalModel2
|
|
66
68
|
```
|
|
@@ -131,10 +133,8 @@ emit:
|
|
|
131
133
|
options:
|
|
132
134
|
"@azure-tools/typespec-java":
|
|
133
135
|
emitter-output-dir: "{project-root}/tsp-output"
|
|
134
|
-
|
|
135
|
-
namer: true
|
|
136
|
+
namespace: "com.azure.ai.language.authoring"
|
|
136
137
|
dev-options:
|
|
137
|
-
support-versioning: true
|
|
138
138
|
debug: true
|
|
139
139
|
```
|
|
140
140
|
|
|
@@ -9,24 +9,23 @@
|
|
|
9
9
|
"testserver-run": "npx cadl-ranch serve ./node_modules/@azure-tools/cadl-ranch-specs/http --coverageFile ./cadl-ranch-coverage-java.json"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@
|
|
13
|
-
"@azure-tools/typespec-
|
|
14
|
-
"@azure-tools/cadl-ranch-specs": "0.24.0",
|
|
15
|
-
"@azure-tools/typespec-java": "file:/../typespec-extension/azure-tools-typespec-java-0.11.1.tgz"
|
|
12
|
+
"@azure-tools/cadl-ranch-specs": "0.28.6",
|
|
13
|
+
"@azure-tools/typespec-java": "file:/../typespec-extension/azure-tools-typespec-java-0.12.2.tgz"
|
|
16
14
|
},
|
|
17
15
|
"devDependencies": {
|
|
18
|
-
"@typespec/prettier-plugin-typespec": "~0.
|
|
19
|
-
"prettier-plugin-organize-imports": "3.2.
|
|
20
|
-
"prettier": "~3.0
|
|
16
|
+
"@typespec/prettier-plugin-typespec": "~0.51.0",
|
|
17
|
+
"prettier-plugin-organize-imports": "3.2.4",
|
|
18
|
+
"prettier": "~3.1.0",
|
|
19
|
+
"@azure-tools/typespec-azure-resource-manager": ">=0.37.1 <1.0.0"
|
|
21
20
|
},
|
|
22
21
|
"overrides": {
|
|
23
|
-
"@typespec/compiler": ">=0.
|
|
24
|
-
"@typespec/http": ">=0.
|
|
25
|
-
"@typespec/rest": ">=0.
|
|
26
|
-
"@typespec/versioning": ">=0.
|
|
27
|
-
"@typespec/openapi": ">=0.
|
|
28
|
-
"@azure-tools/typespec-azure-core": ">=0.
|
|
29
|
-
"@azure-tools/typespec-client-generator-core": ">=0.
|
|
22
|
+
"@typespec/compiler": ">=0.51.0 <1.0.0",
|
|
23
|
+
"@typespec/http": ">=0.51.0 <1.0.0",
|
|
24
|
+
"@typespec/rest": ">=0.51.0 <1.0.0",
|
|
25
|
+
"@typespec/versioning": ">=0.51.0 <1.0.0",
|
|
26
|
+
"@typespec/openapi": ">=0.51.0 <1.0.0",
|
|
27
|
+
"@azure-tools/typespec-azure-core": ">=0.37.2 <1.0.0",
|
|
28
|
+
"@azure-tools/typespec-client-generator-core": ">=0.37.0 <1.0.0"
|
|
30
29
|
},
|
|
31
30
|
"private": true
|
|
32
31
|
}
|
package/typespec-tests/readme.md
CHANGED
|
@@ -8,23 +8,50 @@ Install Node.js and [TypeSpec](https://github.com/microsoft/typespec/).
|
|
|
8
8
|
npm install -g @typespec/compiler
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
## Build JAR
|
|
11
|
+
## Build JAR, Build and Install TypeSpec-Java
|
|
12
12
|
|
|
13
|
-
`
|
|
13
|
+
`pwsh Setup.ps1 -RebuildJar` in `./typespec-tests` folder.
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
It builds JAR and makes the npm package in `./typespec-extension`, then install it to `./typespec-tests` folder.
|
|
16
16
|
|
|
17
|
-
##
|
|
17
|
+
## Generate Code
|
|
18
18
|
|
|
19
|
-
`pwsh
|
|
19
|
+
`pwsh Generate.ps1` in `./typespec-tests` folder.
|
|
20
20
|
|
|
21
|
-
It
|
|
21
|
+
It takes time.
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
The existing code is already in sync. Run this if you have changed the code of TypeSpec-Java.
|
|
24
|
+
|
|
25
|
+
## Run Test
|
|
26
|
+
|
|
27
|
+
Start Cadl-Ranch
|
|
28
|
+
|
|
29
|
+
`npm run testserver-run`
|
|
30
|
+
|
|
31
|
+
Then, run the tests in `typespec-tests` module as usual Java Tests.
|
|
32
|
+
|
|
33
|
+
## Generate Code for TypeSpec Source
|
|
24
34
|
|
|
25
35
|
`tsp compile <target.tsp>` in `./typespec-tests` folder.
|
|
26
36
|
|
|
27
|
-
|
|
37
|
+
This is usually to do a quick check whether the modified TypeSpec-Java works as expected.
|
|
38
|
+
|
|
39
|
+
Generated code will be at `./typespec-tests/tsp-output/` folder for inspect.
|
|
40
|
+
|
|
41
|
+
## Debugging Java code
|
|
42
|
+
|
|
43
|
+
`tspconfig.yaml` already configured
|
|
44
|
+
```yaml
|
|
45
|
+
dev-options:
|
|
46
|
+
generate-code-model: true
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
With this option, a `code-model.yaml` file is kept in `./typespec-tests/tsp-output/` folder after `tsp compile <target.tsp>`.
|
|
50
|
+
|
|
51
|
+
`Main.java` under `./typespec-extension` would load this `code-model.yaml` file as default, and run the Java code to generate the code.
|
|
52
|
+
At this stage, one can modify or debug the Java code (`./typespec-extension/src/main/java/`) in IDE. The code generated in `./typespec-tests/tsp-output/` would reflect the modified Java code.
|
|
53
|
+
|
|
54
|
+
Notice: there maybe some difference of other option between `tspconfig.yaml` and `EmitterOptions.java`. Remember to temporary modify `EmitterOptions.java` to reflect the option in `tspconfig.yaml` when running `Main.java` this way. (e.g. set `streamStyleSerialization` to `true`)
|
|
28
55
|
|
|
29
56
|
## Troubleshooting
|
|
30
57
|
|
package/fluentnamer/package.json
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@autorest/java.fluentnamer",
|
|
3
|
-
"version": "4.0.0",
|
|
4
|
-
"description": "The Java extension for fluentnamer in AutoRest.",
|
|
5
|
-
"scripts": {
|
|
6
|
-
"autorest": "autorest",
|
|
7
|
-
"start": "java -jar target/azure-autorest-fluentnamer-jar-with-dependencies.jar",
|
|
8
|
-
"debug": "java -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,quiet=y,address=5005 -jar target/azure-autorest-fluentnamer-jar-with-dependencies.jar",
|
|
9
|
-
"build": "mvn package -P local"
|
|
10
|
-
},
|
|
11
|
-
"repository": {
|
|
12
|
-
"type": "git",
|
|
13
|
-
"url": "https://github.com/Azure/autorest.java"
|
|
14
|
-
},
|
|
15
|
-
"readme": "./readme.md",
|
|
16
|
-
"keywords": [
|
|
17
|
-
"autorest",
|
|
18
|
-
"java"
|
|
19
|
-
],
|
|
20
|
-
"author": "Microsoft Corporation",
|
|
21
|
-
"license": "MIT",
|
|
22
|
-
"bugs": {
|
|
23
|
-
"url": "https://github.com/Azure/autorest.java/issues"
|
|
24
|
-
},
|
|
25
|
-
"homepage": "https://github.com/Azure/autorest.java/blob/main/README.md"
|
|
26
|
-
}
|
package/fluentnamer/readme.md
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
#### Fluentnamer
|
|
2
|
-
|
|
3
|
-
``` yaml
|
|
4
|
-
pass-thru:
|
|
5
|
-
- model-deduplicator
|
|
6
|
-
- subset-reducer
|
|
7
|
-
|
|
8
|
-
use-extension:
|
|
9
|
-
"@autorest/modelerfour": "4.26.2"
|
|
10
|
-
|
|
11
|
-
pipeline:
|
|
12
|
-
|
|
13
|
-
# --- extension remodeler ---
|
|
14
|
-
|
|
15
|
-
# "Shake the tree", and normalize the model
|
|
16
|
-
modelerfour:
|
|
17
|
-
input: openapi-document/multi-api/identity # the plugin where we get inputs from
|
|
18
|
-
|
|
19
|
-
# allow developer to do transformations on the code model.
|
|
20
|
-
modelerfour/new-transform:
|
|
21
|
-
input: modelerfour
|
|
22
|
-
|
|
23
|
-
fluentnamer:
|
|
24
|
-
input: modelerfour/identity
|
|
25
|
-
naming:
|
|
26
|
-
override:
|
|
27
|
-
eTag: etag
|
|
28
|
-
userName: username
|
|
29
|
-
metaData: metadata
|
|
30
|
-
timeStamp: timestamp
|
|
31
|
-
hostName: hostname
|
|
32
|
-
webHook: webhook
|
|
33
|
-
coolDown: cooldown
|
|
34
|
-
resourceregion: resourceRegion
|
|
35
|
-
sTag: stag
|
|
36
|
-
tagname: tagName
|
|
37
|
-
tagvalue: tagValue
|
|
38
|
-
|
|
39
|
-
modelerfour:
|
|
40
|
-
flatten-models: false
|
|
41
|
-
flatten-payloads: false
|
|
42
|
-
|
|
43
|
-
additional-checks: true
|
|
44
|
-
lenient-model-deduplication: false
|
|
45
|
-
remove-empty-child-schemas: false
|
|
46
|
-
seal-single-value-enum-by-default: true
|
|
47
|
-
|
|
48
|
-
naming:
|
|
49
|
-
choiceValue: upper
|
|
50
|
-
preserve-uppercase-max-length: 2
|
|
51
|
-
override:
|
|
52
|
-
ip: Ip
|
|
53
|
-
id: Id
|
|
54
|
-
|
|
55
|
-
include-x-ms-examples-original-file: true
|
|
56
|
-
|
|
57
|
-
license-header: MICROSOFT_MIT_SMALL
|
|
58
|
-
regenerate-pom: true
|
|
59
|
-
sync-methods: all
|
|
60
|
-
client-side-validations: true
|
|
61
|
-
client-logger: true
|
|
62
|
-
generate-client-interfaces: true
|
|
63
|
-
required-parameter-client-methods: true
|
|
64
|
-
client-flattened-annotation-target: none
|
|
65
|
-
null-byte-array-maps-to-empty-array: true
|
|
66
|
-
graal-vm-config: true
|
|
67
|
-
```
|
|
Binary file
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@autorest/java.postprocessor",
|
|
3
|
-
"version": "4.0.0",
|
|
4
|
-
"description": "The Java extension for postprocessor in AutoRest.",
|
|
5
|
-
"scripts": {
|
|
6
|
-
"autorest": "autorest",
|
|
7
|
-
"start": "java -jar target/azure-autorest-postprocessor-jar-with-dependencies.jar",
|
|
8
|
-
"debug": "java -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,quiet=y,address=5005 -jar target/azure-autorest-postprocessor-jar-with-dependencies.jar",
|
|
9
|
-
"build": "mvn package -Dlocal"
|
|
10
|
-
},
|
|
11
|
-
"repository": {
|
|
12
|
-
"type": "git",
|
|
13
|
-
"url": "https://github.com/Azure/autorest.java"
|
|
14
|
-
},
|
|
15
|
-
"readme": "./readme.md",
|
|
16
|
-
"keywords": [
|
|
17
|
-
"autorest",
|
|
18
|
-
"java"
|
|
19
|
-
],
|
|
20
|
-
"author": "Microsoft Corporation",
|
|
21
|
-
"license": "MIT",
|
|
22
|
-
"bugs": {
|
|
23
|
-
"url": "https://github.com/Azure/autorest/issues"
|
|
24
|
-
},
|
|
25
|
-
"homepage": "https://github.com/Azure/autorest.java/blob/main/README.md"
|
|
26
|
-
}
|
package/postprocessor/readme.md
DELETED
|
Binary file
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@autorest/java.preprocessor",
|
|
3
|
-
"version": "4.0.0",
|
|
4
|
-
"description": "The Java extension for preprocessor in AutoRest.",
|
|
5
|
-
"scripts": {
|
|
6
|
-
"autorest": "autorest",
|
|
7
|
-
"start": "java -jar target/azure-autorest-preprocessor-jar-with-dependencies.jar",
|
|
8
|
-
"debug": "java -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,quiet=y,address=5005 -jar target/azure-autorest-preprocessor-jar-with-dependencies.jar",
|
|
9
|
-
"build": "mvn package -Dlocal"
|
|
10
|
-
},
|
|
11
|
-
"repository": {
|
|
12
|
-
"type": "git",
|
|
13
|
-
"url": "https://github.com/Azure/autorest.java"
|
|
14
|
-
},
|
|
15
|
-
"readme": "./readme.md",
|
|
16
|
-
"keywords": [
|
|
17
|
-
"autorest",
|
|
18
|
-
"java"
|
|
19
|
-
],
|
|
20
|
-
"author": "Microsoft Corporation",
|
|
21
|
-
"license": "MIT",
|
|
22
|
-
"bugs": {
|
|
23
|
-
"url": "https://github.com/Azure/autorest/issues"
|
|
24
|
-
},
|
|
25
|
-
"homepage": "https://github.com/Azure/autorest.java/blob/main/README.md"
|
|
26
|
-
}
|
package/preprocessor/readme.md
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
#### Preprocessor
|
|
2
|
-
|
|
3
|
-
``` yaml
|
|
4
|
-
pass-thru:
|
|
5
|
-
- model-deduplicator
|
|
6
|
-
- subset-reducer
|
|
7
|
-
|
|
8
|
-
use-extension:
|
|
9
|
-
"@autorest/modelerfour": "4.26.2"
|
|
10
|
-
|
|
11
|
-
pipeline:
|
|
12
|
-
|
|
13
|
-
# --- extension remodeler ---
|
|
14
|
-
|
|
15
|
-
# "Shake the tree", and normalize the model
|
|
16
|
-
modelerfour:
|
|
17
|
-
input: openapi-document/multi-api/identity # the plugin where we get inputs from
|
|
18
|
-
|
|
19
|
-
# allow developer to do transformations on the code model.
|
|
20
|
-
modelerfour/new-transform:
|
|
21
|
-
input: modelerfour
|
|
22
|
-
|
|
23
|
-
preprocessor:
|
|
24
|
-
input: modelerfour/identity
|
|
25
|
-
|
|
26
|
-
modelerfour:
|
|
27
|
-
seal-single-value-enum-by-default: true
|
|
28
|
-
|
|
29
|
-
skip-special-headers:
|
|
30
|
-
- Repeatability-Request-ID
|
|
31
|
-
- Repeatability-First-Sent
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
```yaml !$(data-plane)
|
|
35
|
-
modelerfour:
|
|
36
|
-
flatten-models: true
|
|
37
|
-
flatten-payloads: true
|
|
38
|
-
group-parameters: true
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
```yaml $(data-plane)
|
|
42
|
-
modelerfour:
|
|
43
|
-
flatten-models: false
|
|
44
|
-
flatten-payloads: false
|
|
45
|
-
group-parameters: false
|
|
46
|
-
|
|
47
|
-
lenient-model-deduplication: true
|
|
48
|
-
|
|
49
|
-
naming:
|
|
50
|
-
choiceValue: upper
|
|
51
|
-
preserve-uppercase-max-length: 2
|
|
52
|
-
override:
|
|
53
|
-
ip: Ip
|
|
54
|
-
id: Id
|
|
55
|
-
|
|
56
|
-
require:
|
|
57
|
-
- $(this-folder)data-plane.md
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
```yaml $(data-plane) && $(sdk-integration)
|
|
61
|
-
regenerate-pom: true
|
|
62
|
-
```
|
|
Binary file
|
|
File without changes
|