0
GSONを使用して手動でJSONスキーマを作成したいが、GSONでJsonSchema要素のサポートを見つけられない。私はpojoをスキーマに変換したくないのですが、スキーマをプログラム的に作成したいと思っています。 GSONには何か方法がありますか?次のようなものかもしれません。JSON SCHEMAをPOJOなしでjavaコード+ GSONを使用して手動で生成する
**1 JsonSchema schema = new JsonSchema();
2 schema.Type = JsonSchemaType.Object;
3 schema.Properties = new Dictionary<string, JsonSchema>
4{
5 { "name", new JsonSchema { Type = JsonSchemaType.String } },
6 {
7 "hobbies", new JsonSchema
8 {
9 Type = JsonSchemaType.Array,
10 Items = new List<JsonSchema> { new JsonSchema { Type = JsonSchemaType.String } }
11 }
12 },
13};**