Skip to content

Commit d35979d

Browse files
[Schema Registry] Adding Support for JSON and Custom Schema Formats (Azure#31628)
* JSON schema type * API export * new tests * nit fixes * format updates * test restructuring * api * remove record mode * removing changed tests * WIP - regenerated client from PR * WIP - regenerated client from PR * making content type internal * formatting updates * add content type conversion * format -> content type * trying to regenerate * autorest updates * regenerated code * updating schema format in client * fixing some of the build issues * attempt 1 * regenerated using new transforms * updated generated code * API * feedback Co-authored-by: JoshLove-msft <[email protected]> * fix line breaks in transforms * Changing the schema format values to preserve previous functionality * updating test resources * removing mode * fix * reformatting format * removing test mode * schemaformatinternal to contenttypeinternal * WIP some fixes * updating Avro and JSON test recordings * adding some of the custom schema recordings * removing text file and adding versions to test * updating autorest.md * fixing API * regenerating * making content type internal * moving conversions to schemaformat * test updates * removing mode * re-recorded tests * Removing test mode * re-recording * re-recording * test changes and re-record * prepare for release * beta * trying to fix pipeline * pipeline * pipeline * pipeline pt 3 * remove old recordings * rename * re-record serializer tests * switching back to package ref * switching back to project ref Co-authored-by: JoshLove-msft <[email protected]>
1 parent 73d9a17 commit d35979d

File tree

103 files changed

+4484
-1864
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+4484
-1864
lines changed

sdk/schemaregistry/Azure.Data.SchemaRegistry/CHANGELOG.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
# Release History
22

3-
## 1.4.0-beta.1 (Unreleased)
3+
## 1.4.0-beta.1 (2023-01-12)
44

55
### Features Added
66

7-
### Breaking Changes
8-
9-
### Bugs Fixed
10-
11-
### Other Changes
7+
- Added support for JSON schemas. Currently only Draft 3 of JSON is supported by the service.
8+
- Added support for custom schema formats.
129

1310
## 1.3.0 (2022-10-11)
1411

sdk/schemaregistry/Azure.Data.SchemaRegistry/api/Azure.Data.SchemaRegistry.netstandard2.0.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ namespace Azure.Data.SchemaRegistry
77
private readonly int _dummyPrimitive;
88
public SchemaFormat(string value) { throw null; }
99
public static Azure.Data.SchemaRegistry.SchemaFormat Avro { get { throw null; } }
10+
public static Azure.Data.SchemaRegistry.SchemaFormat Custom { get { throw null; } }
11+
public static Azure.Data.SchemaRegistry.SchemaFormat Json { get { throw null; } }
1012
public bool Equals(Azure.Data.SchemaRegistry.SchemaFormat other) { throw null; }
1113
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
1214
public override bool Equals(object obj) { throw null; }
@@ -43,10 +45,11 @@ public SchemaRegistryClient(string fullyQualifiedNamespace, Azure.Core.TokenCred
4345
}
4446
public partial class SchemaRegistryClientOptions : Azure.Core.ClientOptions
4547
{
46-
public SchemaRegistryClientOptions(Azure.Data.SchemaRegistry.SchemaRegistryClientOptions.ServiceVersion version = Azure.Data.SchemaRegistry.SchemaRegistryClientOptions.ServiceVersion.V2021_10) { }
48+
public SchemaRegistryClientOptions(Azure.Data.SchemaRegistry.SchemaRegistryClientOptions.ServiceVersion version = Azure.Data.SchemaRegistry.SchemaRegistryClientOptions.ServiceVersion.V2022_10) { }
4749
public enum ServiceVersion
4850
{
4951
V2021_10 = 1,
52+
V2022_10 = 2,
5053
}
5154
}
5255
public static partial class SchemaRegistryModelFactory
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
4+
using System;
5+
using System.ComponentModel;
6+
using Azure.Core;
7+
8+
namespace Azure.Data.SchemaRegistry
9+
{
10+
/// <summary> The SerializationType. </summary>
11+
[CodeGenModel("ContentType")]
12+
internal readonly partial struct ContentType : IEquatable<ContentType>
13+
{
14+
private readonly string _value;
15+
16+
/// <summary> application/json; serialization=Avro. </summary>
17+
[CodeGenMember("ApplicationJsonSerializationAvro")]
18+
public static ContentType Avro { get; } = new ContentType(AvroValue);
19+
20+
/// <summary> application/json; serialization=json. </summary>
21+
[CodeGenMember("ApplicationJsonSerializationJson")]
22+
public static ContentType Json { get; } = new ContentType(JsonValue);
23+
24+
/// <summary> text/plain; charset=utf-8. </summary>
25+
[CodeGenMember("TextPlainCharsetUtf8")]
26+
public static ContentType Custom { get; } = new ContentType(CustomValue);
27+
28+
/// <inheritdoc />
29+
[EditorBrowsable(EditorBrowsableState.Never)]
30+
public override bool Equals(object obj) => obj is ContentType other && Equals(other);
31+
/// <inheritdoc />
32+
public bool Equals(ContentType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase);
33+
34+
/// <inheritdoc />
35+
[EditorBrowsable(EditorBrowsableState.Never)]
36+
public override int GetHashCode() => _value?.GetHashCode() ?? 0;
37+
/// <inheritdoc />
38+
public override string ToString() => _value;
39+
}
40+
}

sdk/schemaregistry/Azure.Data.SchemaRegistry/src/Generated/Models/ContentType.cs

Lines changed: 34 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/schemaregistry/Azure.Data.SchemaRegistry/src/Generated/Models/ErrorDetail.cs

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/schemaregistry/Azure.Data.SchemaRegistry/src/Generated/Models/SchemaGroups.Serialization.cs

Lines changed: 7 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/schemaregistry/Azure.Data.SchemaRegistry/src/Generated/Models/SchemaGroups.cs

Lines changed: 10 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/schemaregistry/Azure.Data.SchemaRegistry/src/Generated/Models/SchemaVersions.Serialization.cs

Lines changed: 7 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/schemaregistry/Azure.Data.SchemaRegistry/src/Generated/Models/SchemaVersions.cs

Lines changed: 11 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/schemaregistry/Azure.Data.SchemaRegistry/src/Generated/SchemaGetByIdHeaders.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/schemaregistry/Azure.Data.SchemaRegistry/src/Generated/SchemaGetSchemaVersionHeaders.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/schemaregistry/Azure.Data.SchemaRegistry/src/Generated/SchemaGroupsRestClient.cs

Lines changed: 71 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)