Skip to content

Commit

Permalink
tsp, tcgc, adopt sdkpackage (#2861)
Browse files Browse the repository at this point in the history
* replace logics for process parameter

* bug fix

* add logics for process clients and operation

* replace logic to process response

* regen

* process exception

* rename local var

* add samples

* add loading examples logic

* Revert "regen"

This reverts commit 07a773f.

# Conflicts:
#	typespec-tests/src/main/java/com/cadl/internal/InternalAsyncClient.java
#	typespec-tests/src/main/java/com/cadl/internal/InternalClient.java
#	typespec-tests/src/main/java/com/cadl/internal/implementation/InternalOpsImpl.java
#	typespec-tests/src/main/java/com/cadl/literalservice/implementation/LiteralOpsImpl.java
#	typespec-tests/src/main/java/com/cadl/longrunning/implementation/LongRunningClientImpl.java
#	typespec-tests/src/main/java/com/cadl/naming/NamingAsyncClient.java
#	typespec-tests/src/main/java/com/cadl/naming/NamingClient.java
#	typespec-tests/src/main/java/com/cadl/naming/implementation/NamingOpsImpl.java
#	typespec-tests/src/main/java/com/cadl/optional/OptionalAsyncClient.java
#	typespec-tests/src/main/java/com/cadl/optional/OptionalClient.java
#	typespec-tests/src/main/java/com/cadl/optional/implementation/OptionalOpsImpl.java
#	typespec-tests/src/main/java/com/cadl/wiretype/implementation/WireTypeOpsImpl.java
#	typespec-tests/src/samples/java/com/cadl/flatten/generated/FlattenOpSend.java

* solve conflict

* replace logics for operationIs helpers

* fixed flatten case's example

* convert more functions from using raw to tcgc types

* update test

* update logic to judge if bodyParameterFlatten

* update logics on spread param

* regen

* regen

* use sdkResponse.description and do not use initializationProperty.type.serverUrl for arm

* regen

* handle hierarchical client name

* regen

* update api version filtering part

* merge summary with description

* skip content-type header if body is optional

* regen

* regen

* handle multipart array case

* add endpoint parameter for ARM as workaround

* regen

* regen

* Fixed the api-version being added to builder issue

* solve conflict

* regen

* regen

* integrate with sdkpackage's example

* clean up code

* regen

* code clean up

* support new SdkClientType design

* regen

* throw error if endpoint parameter is neither  union nor endpoint

* lint

* remove unused functions and move removeClientSuffix to util

* support client crossLanguageDefinitionId

* remove unused functions

* remove unused imports

* update according to comments

* lint

* lint

* regen

* add TODO for allowReserved for path url

* update according to comments

* regen

* support client default endpoint

* fix test

* regen

* remove suffix

* format

* remove unused functions

* regen

* fix

* update function name according to comments

* add param location check

* update according to comments

* handle param.onClient

* update method to use shorter name

* apply the bug fix

* regen

* integrate with bug fix on flattened model property and parameter has the same name

* add  op.addParameter(parameter); for param.onclient as well

* format and lint

* fix NotVersionedTests

* revet the changes on onClient and support

* support allowReserved for path

* regen

* update according to comment: paging, content-type

* remove unused logics in processing lro

* lint

* add test case to test HttpStatusCodeRange

* format typespec-tests

* address comments

* bump minor version

* format and lint

* use TCGC sdkBody.contentTypes to set to mediaTypes

* address comments

* changelog

* format and lint

* changelog
  • Loading branch information
haolingdong-msft authored Aug 22, 2024
1 parent 1dc29c0 commit c0c7949
Show file tree
Hide file tree
Showing 452 changed files with 10,545 additions and 7,229 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1594,7 +1594,7 @@ protected static String returnTypeDescription(Operation operation, IType returnT
String description = null;
// try the description of the operation
if (operation.getLanguage() != null && operation.getLanguage().getDefault() != null) {
String operationDescription = operation.getLanguage().getDefault().getDescription();
String operationDescription = SchemaUtil.mergeSummaryWithDescription(operation.getSummary(), operation.getLanguage().getDefault().getDescription());
if (!CoreUtils.isNullOrEmpty(operationDescription)) {
if (operationDescription.toLowerCase().startsWith("get ") || operationDescription.toLowerCase().startsWith("gets ")) {
int startIndex = operationDescription.indexOf(" ") + 1;
Expand Down
8 changes: 8 additions & 0 deletions typespec-extension/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Release History

## 0.20.0 (2024-08-26)

Compatible with compiler 0.59.

- Adopt TCGC `sdkPackage`.
- Always allow override `endpoint` parameter in `Builder`.
- Client method parameters' order changes when define the method parameters using spread in TypeSpec.

## 0.19.3 (2024-08-21)

Compatible with compiler 0.59.
Expand Down
2 changes: 1 addition & 1 deletion typespec-extension/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@azure-tools/typespec-java",
"version": "0.19.3",
"version": "0.20.0",
"description": "TypeSpec library for emitting Java client from the TypeSpec REST protocol binding",
"keywords": [
"TypeSpec"
Expand Down
Loading

0 comments on commit c0c7949

Please sign in to comment.