@autorest/java 4.1.27 → 4.1.28

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.
@@ -4,8 +4,8 @@
4
4
  "description": "The Android extension for classic generators in AutoRest.",
5
5
  "scripts": {
6
6
  "autorest": "autorest",
7
- "start": "java --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED -jar target/azure-autorest-androidgen-jar-with-dependencies.jar",
8
- "debug": "java --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,quiet=y,address=5005 -jar target/azure-autorest-androidgen-jar-with-dependencies.jar",
7
+ "start": "java -jar target/azure-autorest-androidgen-jar-with-dependencies.jar",
8
+ "debug": "java -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,quiet=y,address=5005 -jar target/azure-autorest-androidgen-jar-with-dependencies.jar",
9
9
  "build": "mvn package -Dlocal"
10
10
  },
11
11
  "repository": {
@@ -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 --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED -jar target/azure-autorest-fluentgen-jar-with-dependencies.jar",
8
- "debug": "java --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,quiet=y,address=5005 -jar target/azure-autorest-fluentgen-jar-with-dependencies.jar",
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": {
@@ -76,4 +76,5 @@ required-parameter-client-methods: true
76
76
  client-flattened-annotation-target: none
77
77
  null-byte-array-maps-to-empty-array: true
78
78
  graal-vm-config: true
79
+ stream-style-serialization: false
79
80
  ```
@@ -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 --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED -jar target/azure-autorest-javagen-jar-with-dependencies.jar",
8
- "debug": "java --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,quiet=y,address=5005 -jar target/azure-autorest-javagen-jar-with-dependencies.jar",
7
+ "start": "java -jar target/azure-autorest-javagen-jar-with-dependencies.jar",
8
+ "debug": "java -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,quiet=y,address=5005 -jar target/azure-autorest-javagen-jar-with-dependencies.jar",
9
9
  "build": "mvn package -Dlocal"
10
10
  },
11
11
  "repository": {
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@autorest/java",
3
- "version": "4.1.27",
3
+ "version": "4.1.28",
4
4
  "description": "The Java extension for classic generators in AutoRest.",
5
5
  "scripts": {
6
6
  "autorest": "autorest",
7
- "start": "java --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED -jar javagen/target/azure-autorest-javagen-jar-with-dependencies.jar",
8
- "debug": "java --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,quiet=y,address=5005 -jar javagen/target/azure-autorest-javagen-jar-with-dependencies.jar",
7
+ "start": "java -jar javagen/target/azure-autorest-javagen-jar-with-dependencies.jar",
8
+ "debug": "java -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,quiet=y,address=5005 -jar javagen/target/azure-autorest-javagen-jar-with-dependencies.jar",
9
9
  "build": "mvn package -P local",
10
10
  "generate": "./generate",
11
11
  "testserver-run": "autorest-testserver run",
@@ -40,6 +40,6 @@
40
40
  ],
41
41
  "devDependencies": {
42
42
  "autorest": "^3.7.1",
43
- "@microsoft.azure/autorest.testserver": "3.3.48"
43
+ "@microsoft.azure/autorest.testserver": "3.3.49"
44
44
  }
45
45
  }
package/readme.md CHANGED
@@ -66,7 +66,6 @@ Settings can be provided on the command line through `--name:value` or in a READ
66
66
 
67
67
  |Option  | Description |
68
68
  |------------------|-------------|
69
- |`--enable-xml`|Generates models and clients that can be sent in XML over the wire. Default is false|
70
69
  |`--client-side-validations`|Generate validations for required parameters and required model properties. Default is false.|
71
70
  |`--generate-client-as-impl`|Append "Impl" to the names of service clients and method groups and place them in the `implementation` sub-package. Default is false.|
72
71
  |`--generate-client-interfaces`|Implies `--generate-client-as-impl` and generates interfaces for all the "Impl"s. Default is false.|
@@ -80,14 +79,11 @@ Settings can be provided on the command line through `--name:value` or in a READ
80
79
  |`--custom-types-subpackage=STRING`|The sub-package that the custom types should be generated in. The types that custom types reference, or inherit from will also be automatically moved to this sub-package. **Recommended usage**: You can set this value to `models` and set `--models-subpackage=implementation.models`to generate models to `implementation.models` by default and pick specific models to be public through `--custom-types=`.|
81
80
  |`--client-type-prefix=STRING`|The prefix that will be added to each generated client type.|
82
81
  |`--service-interface-as-public`|Indicates whether to generate service interfaces as public. This resolves `SecurityManager` issues to prevent reflectively access non-public APIs. Default is true.|
83
- |`--require-x-ms-flattened-to-flatten`|Indicates whether `x-ms-flattened` is required to annotated a class with `@JsonFlatten` if the discriminator has `.` in its name. Default is false.|
84
- |`--client-flattened-annotation-target=TYPE,FIELD,NONE,DISABLED`|Indicates the target of `@JsonFlatten` annotation for `x-ms-client-flatten`. Default is `TYPE`. If value is `FIELD`, it implies `require-x-ms-flattened-to-flatten=true`.|
82
+ |`--client-flattened-annotation-target=TYPE,FIELD,NONE,DISABLED`|Indicates the target of `@JsonFlatten` annotation for `x-ms-client-flatten`. Default is `TYPE`.|
85
83
  |`--disable-client-builder`|Indicates whether to disable generating the `ClientBuilder` class. This is for SDK that already contains a hand-written `ClientBuilder` class. Default is false.|
86
- |`--skip-formatting`|Indicates whether to skip formatting Java file. Default is false.|
87
84
  |`--polling`|Configures how to generate long running operations. See [Polling Configuration](#polling-configuration) to see more details on how to use this flag.|
88
85
  |`--service-name`|Service name used in Client class and other documentations. If not provided, service name is deduced from `title` configure (from swagger or readme).|
89
86
  |`--partial-update`|Indicates whether to support partial update for `Client`/`AsyncClient` classes and `ClientBuilder` class.|
90
- |`--pass-discriminator-to-child-deserialization`|Indicates whether the discriminator property is passed to subclass deserialization. Default is false.|
91
87
  |`--default-http-exception-type`|The fully-qualified class name that should be used as the default HTTP exception type. The class must extend from `HttpResponseException`.|
92
88
  |`--use-default-http-status-code-to-exception-type-mapping`|Indicates whether a default HTTP status code to exception mapping should be used if one isn't provided.|
93
89
  |`--http-status-code-to-exception-type-mapping`|The HTTP status code to exception mapping that should be used. All exception types must be fully-qualified and extend from `HttpResponseException`.|
@@ -112,7 +108,6 @@ For example, `generate-client-interfaces`, `generate-client-as-impl`, `generate-
112
108
 
113
109
  `generate-samples` option can be used for generating samples for client.
114
110
  `generate-tests` option can be used for generating tests for client.
115
- `generate-models` option can be used for generating models.
116
111
 
117
112
  See [documentation](docs/generate/dataplane.md) for frequently used options, and their effect on generated clients.
118
113
 
@@ -339,9 +334,6 @@ help-content:
339
334
  activationScope: java
340
335
  categoryFriendlyName: Java Generator
341
336
  settings:
342
- - key: enable-xml
343
- type: bool
344
- description: Generates models and clients that can be sent in XML over the wire. Default is false
345
337
  - key: client-side-validations
346
338
  type: bool
347
339
  description: Generate validations for required parameters and required model properties. Default is false.
@@ -380,13 +372,10 @@ help-content:
380
372
  description: The prefix that will be added to each generated client type.
381
373
  - key: client-flattened-annotation-target
382
374
  type: string
383
- description: \[TYPE,FIELD,NONE,DISABLED] Indicates the target of `@JsonFlatten` annotation for `x-ms-client-flatten`. Default is `TYPE`. If value is `FIELD`, it implies `require-x-ms-flattened-to-flatten=true`.
375
+ description: \[TYPE,FIELD,NONE,DISABLED] Indicates the target of `@JsonFlatten` annotation for `x-ms-client-flatten`. Default is `TYPE`.
384
376
  - key: disable-client-builder
385
377
  type: bool
386
378
  description: Indicates whether to disable generating the `ClientBuilder` class. This is for SDK that already contains a hand-written `ClientBuilder` class. Default is false.
387
- - key: skip-formatting
388
- type: bool
389
- description: Indicates whether to skip formatting Java file. Default is false.
390
379
  - key: polling
391
380
  type: string
392
381
  description: Configures how to generate long running operations. See [Polling Configuration](https://github.com/Azure/autorest.java#polling-configuration) to see more details on how to use this flag.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azure-tools/typespec-java",
3
- "version": "0.13.4",
3
+ "version": "0.15.6",
4
4
  "description": "TypeSpec library for emitting Java client from the TypeSpec REST protocol binding",
5
5
  "keywords": [
6
6
  "TypeSpec"
@@ -45,13 +45,13 @@
45
45
  "target/emitter.jar"
46
46
  ],
47
47
  "peerDependencies": {
48
- "@typespec/compiler": ">=0.52.0 <1.0.0",
49
- "@typespec/http": ">=0.52.0 <1.0.0",
50
- "@typespec/rest": ">=0.52.0 <1.0.0",
51
- "@typespec/openapi": ">=0.52.0 <1.0.0",
52
- "@typespec/versioning": ">=0.52.0 <1.0.0",
53
- "@azure-tools/typespec-azure-core": ">=0.38.0 <1.0.0",
54
- "@azure-tools/typespec-client-generator-core": ">=0.39.0 <1.0.0"
48
+ "@typespec/compiler": ">=0.53.1 <1.0.0",
49
+ "@typespec/http": ">=0.53.0 <1.0.0",
50
+ "@typespec/rest": ">=0.53.0 <1.0.0",
51
+ "@typespec/openapi": ">=0.53.0 <1.0.0",
52
+ "@typespec/versioning": ">=0.53.0 <1.0.0",
53
+ "@azure-tools/typespec-azure-core": ">=0.40.0 <1.0.0",
54
+ "@azure-tools/typespec-client-generator-core": ">=0.40.0 <1.0.0"
55
55
  },
56
56
  "dependencies": {
57
57
  "@autorest/codemodel": "~4.20.0",
@@ -60,24 +60,24 @@
60
60
  },
61
61
  "devDependencies": {
62
62
  "prettier": "~3.2.5",
63
- "@types/lodash": "~4.14.202",
63
+ "@types/lodash": "~4.17.0",
64
64
  "@types/js-yaml": "~4.0.9",
65
65
  "@types/mocha": "~10.0.6",
66
- "@types/node": "~20.11.16",
66
+ "@types/node": "~20.11.30",
67
67
  "c8": "~9.1.0",
68
- "eslint": "~8.56.0",
69
- "mocha": "~10.2.0",
68
+ "eslint": "~8.57.0",
69
+ "mocha": "~10.3.0",
70
70
  "rimraf": "~5.0.5",
71
- "typescript": "~5.3.3",
72
- "@typescript-eslint/parser": "~6.21.0",
73
- "@typescript-eslint/eslint-plugin": "~6.21.0",
71
+ "typescript": "~5.4.3",
72
+ "@typescript-eslint/parser": "~7.4.0",
73
+ "@typescript-eslint/eslint-plugin": "~7.4.0",
74
74
  "eslint-plugin-deprecation": "~2.0.0",
75
- "@azure-tools/typespec-azure-core": "0.39.0",
76
- "@azure-tools/typespec-client-generator-core": "0.39.0",
77
- "@typespec/compiler": "0.53.0",
78
- "@typespec/http": "0.53.0",
79
- "@typespec/openapi": "0.53.0",
80
- "@typespec/rest": "0.53.0",
81
- "@typespec/versioning": "0.53.0"
75
+ "@azure-tools/typespec-azure-core": "0.40.0",
76
+ "@azure-tools/typespec-client-generator-core": "0.40.0",
77
+ "@typespec/compiler": "0.54.0",
78
+ "@typespec/http": "0.54.0",
79
+ "@typespec/openapi": "0.54.0",
80
+ "@typespec/rest": "0.54.0",
81
+ "@typespec/versioning": "0.54.0"
82
82
  }
83
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.53.
7
+ Install [TypeSpec](https://github.com/microsoft/typespec/) 0.54.
8
8
 
9
9
  # Initialize TypeSpec Project
10
10
 
@@ -57,7 +57,7 @@ options:
57
57
  service-versions:
58
58
  - "2022-05-15-preview"
59
59
  enable-sync-stack: true
60
- stream-style-serialization: false
60
+ stream-style-serialization: true
61
61
  generate-samples: true
62
62
  generate-tests: true
63
63
  examples-directory: "./examples"
@@ -145,4 +145,4 @@ Force an installation of new version via deleting `package-lock.json` and `node_
145
145
  ```shell
146
146
  rm -rf node_modules
147
147
  rm package-lock.json
148
- ```
148
+ ```
@@ -9,23 +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
- "@azure-tools/cadl-ranch-specs": "0.29.0",
13
- "@azure-tools/typespec-java": "file:/../typespec-extension/azure-tools-typespec-java-0.13.4.tgz"
12
+ "@azure-tools/cadl-ranch-specs": "0.31.5",
13
+ "@azure-tools/typespec-java": "file:/../typespec-extension/azure-tools-typespec-java-0.15.6.tgz"
14
14
  },
15
15
  "devDependencies": {
16
- "@typespec/prettier-plugin-typespec": "~0.53.0",
17
- "@azure-tools/typespec-azure-resource-manager": "~0.39.0",
16
+ "@typespec/prettier-plugin-typespec": "~0.54.0",
17
+ "@azure-tools/typespec-azure-resource-manager": "~0.40.0",
18
18
  "prettier-plugin-organize-imports": "3.2.4",
19
19
  "prettier": "~3.2.5"
20
20
  },
21
21
  "overrides": {
22
- "@typespec/compiler": ">=0.52.0 <1.0.0",
23
- "@typespec/http": ">=0.52.0 <1.0.0",
24
- "@typespec/rest": ">=0.52.0 <1.0.0",
25
- "@typespec/versioning": ">=0.52.0 <1.0.0",
26
- "@typespec/openapi": ">=0.52.0 <1.0.0",
27
- "@azure-tools/typespec-azure-core": ">=0.38.0 <1.0.0",
28
- "@azure-tools/typespec-client-generator-core": ">=0.38.0 <1.0.0"
22
+ "@typespec/compiler": ">=0.53.1 <1.0.0",
23
+ "@typespec/http": ">=0.53.0 <1.0.0",
24
+ "@typespec/rest": ">=0.53.0 <1.0.0",
25
+ "@typespec/versioning": ">=0.53.0 <1.0.0",
26
+ "@typespec/openapi": ">=0.53.0 <1.0.0",
27
+ "@azure-tools/typespec-azure-core": ">=0.34.0 <1.0.0",
28
+ "@azure-tools/typespec-client-generator-core": ">=0.34.0 <1.0.0"
29
29
  },
30
30
  "private": true
31
31
  }
@@ -48,7 +48,7 @@ Generated code will be at `./typespec-tests/tsp-output/` folder for inspect.
48
48
 
49
49
  With this option, a `code-model.yaml` file is kept in `./typespec-tests/tsp-output/` folder after `tsp compile <target.tsp>`.
50
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 (`google-java-format` used in the module requires adding `--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED` to VM options).
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
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
53
 
54
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`)