Skip to content

Commit 0aa5bfc

Browse files
authored
[schema-registry-json] Update samples ID (Azure#26740)
1 parent e22be9b commit 0aa5bfc

File tree

7 files changed

+20
-6
lines changed

7 files changed

+20
-6
lines changed

sdk/schemaregistry/schema-registry-json/samples-dev/schemaRegistryJsonSample.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const groupName = process.env["SCHEMA_REGISTRY_GROUP"] || "AzureSdkSampleGroup";
2727
// Sample Json Schema for user with first and last names
2828
export const schemaObject = {
2929
$schema: "https://json-schema.org/draft/2020-12/schema",
30-
$id: "https://example.com/product.schema.json",
30+
$id: "user",
3131
title: "User",
3232
description: "A user for the product",
3333
type: "object",

sdk/schemaregistry/schema-registry-json/samples-dev/schemaRegistryJsonWithValidation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const groupName = process.env["SCHEMA_REGISTRY_GROUP"] || "AzureSdkSampleGroup";
2828
// Sample Json Schema for user with first and last names
2929
export const schemaObject = {
3030
$schema: "https://json-schema.org/draft/2020-12/schema",
31-
$id: "https://example.com/product.schema.json",
31+
$id: "user",
3232
title: "User",
3333
description: "A user for the product",
3434
type: "object",

sdk/schemaregistry/schema-registry-json/samples/v1-beta/javascript/schemaRegistryJsonSample.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const groupName = process.env["SCHEMA_REGISTRY_GROUP"] || "AzureSdkSampleGroup";
2222
// Sample Json Schema for user with first and last names
2323
const schemaObject = {
2424
$schema: "https://json-schema.org/draft/2020-12/schema",
25-
$id: "https://example.com/product.schema.json",
25+
$id: "user",
2626
title: "User",
2727
description: "A user for the product",
2828
type: "object",

sdk/schemaregistry/schema-registry-json/samples/v1-beta/javascript/schemaRegistryJsonWithValidation.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const groupName = process.env["SCHEMA_REGISTRY_GROUP"] || "AzureSdkSampleGroup";
2323
// Sample Json Schema for user with first and last names
2424
const schemaObject = {
2525
$schema: "https://json-schema.org/draft/2020-12/schema",
26-
$id: "https://example.com/product.schema.json",
26+
$id: "user",
2727
title: "User",
2828
description: "A user for the product",
2929
type: "object",

sdk/schemaregistry/schema-registry-json/samples/v1-beta/typescript/src/schemaRegistryJsonSample.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const groupName = process.env["SCHEMA_REGISTRY_GROUP"] || "AzureSdkSampleGroup";
2727
// Sample Json Schema for user with first and last names
2828
export const schemaObject = {
2929
$schema: "https://json-schema.org/draft/2020-12/schema",
30-
$id: "https://example.com/product.schema.json",
30+
$id: "user",
3131
title: "User",
3232
description: "A user for the product",
3333
type: "object",

sdk/schemaregistry/schema-registry-json/samples/v1-beta/typescript/src/schemaRegistryJsonWithValidation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const groupName = process.env["SCHEMA_REGISTRY_GROUP"] || "AzureSdkSampleGroup";
2828
// Sample Json Schema for user with first and last names
2929
export const schemaObject = {
3030
$schema: "https://json-schema.org/draft/2020-12/schema",
31-
$id: "https://example.com/product.schema.json",
31+
$id: "user",
3232
title: "User",
3333
description: "A user for the product",
3434
type: "object",

sdk/schemaregistry/schema-registry-json/test/public/errors.spec.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,20 @@ describe("Error scenarios", function () {
164164
}
165165
);
166166
});
167+
it("schema with invalid ID", async function () {
168+
await assertError(
169+
serializer.serialize(
170+
null,
171+
JSON.stringify({
172+
$schema: "https://json-schema.org/draft/2020-12/schema",
173+
$id: "https://example.com/product.schema.json",
174+
})
175+
),
176+
{
177+
message: /contain invalid characters/,
178+
}
179+
);
180+
});
167181
it("schema with invalid type", async function () {
168182
if (!isLiveMode()) {
169183
this.skip();

0 commit comments

Comments
 (0)