Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
changeKind: fix
packages:
- "@typespec/http-client-java"
---

Missing example value for BinaryData type in mock test.
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public static Object jsonFromType(int depth, IType type) {
return UUID.randomUUID().toString();
} else if (type == ClassType.URL) {
return "http://example.org/" + URLEncoder.encode(randomString(), StandardCharsets.UTF_8);
} else if (type == ClassType.OBJECT) {
} else if (type == ClassType.OBJECT || type == ClassType.BINARY_DATA) {
// unknown type, use a simple string
return "data" + randomString();
} else if (type instanceof EnumType) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,6 @@ $generateScript = {
} elseif ($tspFile -match "azure[\\/]resource-manager[\\/]multi-service-shared-models[\\/]") {
$tspOptions += " --option ""@typespec/http-client-java.metadata-suffix=shared-models"""
} elseif ($tspFile -match "tsp[\\/]arm.tsp") {
# for mgmt, do not generate tests due to random mock values
$tspOptions += " --option ""@typespec/http-client-java.generate-tests=false"""
# test service-name
$tspOptions += " --option ""@typespec/http-client-java.service-name=Arm Resource Provider"""
# also test generating from specific api-version
Expand All @@ -105,8 +103,6 @@ $generateScript = {
# enable client side validations
$tspOptions += " --option ""@typespec/http-client-java.client-side-validations=true"""
} elseif ($tspFile -match "tsp[\\/]arm-customization.tsp") {
# for mgmt, do not generate tests due to random mock values
$tspOptions += " --option ""@typespec/http-client-java.generate-tests=false"""
# add customization code
$tspOptions += " --option ""@typespec/http-client-java.customization-class=../../customization/src/main/java/KeyVaultCustomization.java"""
} elseif ($tspFile -match "tsp[\\/]arm-versioned.tsp") {
Expand Down
Loading
Loading