diff --git a/plugins/config.yaml b/plugins/config.yaml index d7f5274..0feb580 100644 --- a/plugins/config.yaml +++ b/plugins/config.yaml @@ -3,5 +3,5 @@ plugins: id: tekuriValidator config: #schema_dir: plugins/schemas/ #approach 1 - schema_dir: plugins/schema/ondc_trv10/ #approach 2 + schema_dir: plugins/schemas/ #approach 2 plugin_path: plugins/implementations/ # Path to the directory containing the .so files \ No newline at end of file diff --git a/plugins/implementations/plugin_impl.go b/plugins/implementations/plugin_impl.go index fde1fe9..6c7aaa7 100644 --- a/plugins/implementations/plugin_impl.go +++ b/plugins/implementations/plugin_impl.go @@ -4,7 +4,7 @@ import ( "context" "encoding/json" "fmt" - "io/ioutil" + "os" "path/filepath" "beckn-onix/plugins" @@ -29,7 +29,6 @@ func (v *tekuriValidator) Validate(ctx context.Context, data []byte) error { if err := json.Unmarshal(data, &jsonData); err != nil { return err } - fmt.Println("json data : ", jsonData) err := v.schema.Validate(jsonData) if err != nil { fmt.Printf("Validation error: %v\n", err) @@ -43,47 +42,100 @@ func (v *tekuriValidator) Validate(ctx context.Context, data []byte) error { //(Approach 2)(all json files for each schema) // Initialize reads all .json files from the given schema directory, validates them using JSON Schema, and prints the result. +// func (vp *tekuriValidatorProvider) Initialize(schemaDir string) (map[string]plugins.Validator, error) { +// //start := time.Now() +// // Initialize the cache +// vp.schemaCache = make(map[string]map[string]*jsonschema.Schema) +// validatorCache := make(map[string]plugins.Validator) + +// // Read the directory +// files, err := ioutil.ReadDir(schemaDir) +// if err != nil { +// return nil, fmt.Errorf("failed to read schema directory: %v", err) +// } + +// for _, file := range files { +// if filepath.Ext(file.Name()) == ".json" { +// // Read the JSON file +// filePath := filepath.Join(schemaDir, file.Name()) +// fmt.Println("file path : ", filePath) +// compiler := jsonschema.NewCompiler() +// compiledSchema, err := compiler.Compile(filePath) +// if err != nil { +// return nil, fmt.Errorf("failed to compile JSON schema from file %s: %v", file.Name(), err) +// } +// if compiledSchema == nil { +// return nil, fmt.Errorf("compiled schema is nil for file %s", file.Name()) +// } +// // Extract directory and filename to use in the nested map +// dir := filepath.Base(filepath.Dir(filePath)) +// if vp.schemaCache[dir] == nil { +// vp.schemaCache[dir] = make(map[string]*jsonschema.Schema) +// } +// // Store the compiled schema in the nested cache +// vp.schemaCache[dir][file.Name()] = compiledSchema + +// validatorCache[file.Name()] = &tekuriValidator{schema: compiledSchema} +// } +// } +// // fmt.Printf("initialize executed in %s\n", time.Since(start)) + +// return validatorCache, nil +// } + +// (Approach 2)(all json files for each schema from sub directories) + func (vp *tekuriValidatorProvider) Initialize(schemaDir string) (map[string]plugins.Validator, error) { - //start := time.Now() - // Initialize the cache vp.schemaCache = make(map[string]map[string]*jsonschema.Schema) validatorCache := make(map[string]plugins.Validator) - // Read the directory - files, err := ioutil.ReadDir(schemaDir) - if err != nil { - return nil, fmt.Errorf("failed to read schema directory: %v", err) - } + // Walk through the directory and compile all .json files + err := filepath.Walk(schemaDir, func(path string, info os.FileInfo, err error) error { + if err != nil { + return err + } + if !info.IsDir() && filepath.Ext(info.Name()) == ".json" { + filePath := filepath.Join(schemaDir, info.Name()) + fmt.Println("printing path : ", path) + fmt.Println("Compiling file path: ", filePath) - for _, file := range files { - if filepath.Ext(file.Name()) == ".json" { - // Read the JSON file - filePath := filepath.Join(schemaDir, file.Name()) - fmt.Println("file path : ", filePath) compiler := jsonschema.NewCompiler() - compiledSchema, err := compiler.Compile(filePath) + + compiledSchema, err := compiler.Compile(path) if err != nil { - return nil, fmt.Errorf("failed to compile JSON schema from file %s: %v", file.Name(), err) + return fmt.Errorf("failed to compile JSON schema from file %s: %v", info.Name(), err) } if compiledSchema == nil { - return nil, fmt.Errorf("compiled schema is nil for file %s", file.Name()) + return fmt.Errorf("compiled schema is nil for file %s", info.Name()) } - // Extract directory and filename to use in the nested map + + fmt.Printf("Compiled schema for file %s: %+v\n", info.Name(), compiledSchema) + dir := filepath.Base(filepath.Dir(filePath)) if vp.schemaCache[dir] == nil { vp.schemaCache[dir] = make(map[string]*jsonschema.Schema) } - // Store the compiled schema in the nested cache - vp.schemaCache[dir][file.Name()] = compiledSchema - - validatorCache[file.Name()] = &tekuriValidator{schema: compiledSchema} + vp.schemaCache[dir][info.Name()] = compiledSchema + validatorCache[info.Name()] = &tekuriValidator{schema: compiledSchema} } + return nil + }) + if err != nil { + return nil, fmt.Errorf("failed to read schema directory: %v", err) } - // fmt.Printf("initialize executed in %s\n", time.Since(start)) return validatorCache, nil } +var _ plugins.ValidatorProvider = (*tekuriValidatorProvider)(nil) + +var providerInstance = &tekuriValidatorProvider{} + +func GetProvider() plugins.ValidatorProvider { + return providerInstance +} + +////////////////////////////////////////////////////////// // (Approach 1) // func (vp *tekuriValidatorProvider) Initialize(schemaDir string) (map[string]plugins.Validator, error) { // // start := time.Now() @@ -137,13 +189,3 @@ func (vp *tekuriValidatorProvider) Initialize(schemaDir string) (map[string]plug // // fmt.Printf("Initialize executed in %s\n", time.Since(start)) // return validatorCache, nil // } - -// Ensure tekuriValidatorProvider implements ValidatorProvider -var _ plugins.ValidatorProvider = (*tekuriValidatorProvider)(nil) - -var providerInstance = &tekuriValidatorProvider{} - -// Exported function to return the provider instance -func GetProvider() plugins.ValidatorProvider { - return providerInstance -} diff --git a/plugins/implementations/tekuriValidator.so b/plugins/implementations/tekuriValidator.so index 031ffc1..166e1fa 100644 Binary files a/plugins/implementations/tekuriValidator.so and b/plugins/implementations/tekuriValidator.so differ diff --git a/plugins/schema/beckn_base/api/build.json b/plugins/schema/beckn_base/api/build.json deleted file mode 100644 index e69de29..0000000 diff --git a/plugins/schema/beckn_base/api/io/cancel.json b/plugins/schema/beckn_base/api/io/cancel.json deleted file mode 100644 index 8828931..0000000 --- a/plugins/schema/beckn_base/api/io/cancel.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://ondc.org/trv10/2.0.0/cancel", - "type": "object", - "properties": { - "context": { - "allOf": [ - { - "$ref": "../schema/components.json#/$defs/Context" - }, - { - "type": "object", - "properties": { - "action": { - "enum": [ - "cancel" - ] - } - }, - "required": [ - "action" - ] - } - ] - }, - "message": { - "type": "object", - "additionalProperties": false, - "properties": { - "order_id": { - "$ref": "../schema/components.json#/$defs/Order" - }, - "cancellation_reason_id": { - "$ref": "../schema/components.json#/$defs/Option" - }, - "descriptor": { - "$ref": "../schema/components.json#/$defs/Descriptor" - } - }, - "required": [ - "order_id" - ] - } - }, - "required": [ - "message", - "context" - ] -} \ No newline at end of file diff --git a/plugins/schema/beckn_base/api/io/on_rating.json b/plugins/schema/beckn_base/api/io/on_rating.json deleted file mode 100644 index 8202a00..0000000 --- a/plugins/schema/beckn_base/api/io/on_rating.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://ondc.org/trv10/2.0.0/on_rating", - "type": "object", - "properties": { - "context": { - "allOf": [ - { - "$ref": "../schema/components.json#/$defs/Context" - }, - { - "type": "object", - "properties": { - "action": { - "enum": [ - "on_rating" - ] - } - }, - "required": [ - "action" - ] - } - ] - }, - "message": { - "type": "object", - "properties": { - "feedback_form": { - "description": "A feedback form to allow the user to provide additional information on the rating provided", - "allOf": [ - { - "$ref": "../schema/components.json#/$defs/XInput" - } - ] - } - } - }, - "error": { - "$ref": "../schema/components.json#/$defs/Error" - } - }, - "required": [ - "context", - "message" - ] -} \ No newline at end of file diff --git a/plugins/schema/beckn_base/api/io/on_support.json b/plugins/schema/beckn_base/api/io/on_support.json deleted file mode 100644 index a35cef6..0000000 --- a/plugins/schema/beckn_base/api/io/on_support.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://ondc.org/trv10/2.0.0/on_support", - "type": "object", - "properties": { - "context": { - "allOf": [ - { - "$ref": "../schema/components.json#/$defs/Context" - }, - { - "type": "object", - "properties": { - "action": { - "enum": [ - "on_support" - ] - } - }, - "required": [ - "action" - ] - } - ] - }, - "message": { - "type": "object", - "properties": { - "support": { - "$ref": "../schema/components.json#/$defs/Support" - } - } - }, - "error": { - "$ref": "../schema/components.json#/$defs/Error" - } - }, - "required": [ - "context", - "message" - ] -} \ No newline at end of file diff --git a/plugins/schema/beckn_base/api/io/on_track.json b/plugins/schema/beckn_base/api/io/on_track.json deleted file mode 100644 index 5cccf25..0000000 --- a/plugins/schema/beckn_base/api/io/on_track.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://ondc.org/trv10/2.0.0/on_track", - "type": "object", - "properties": { - "context": { - "allOf": [ - { - "$ref": "../schema/components.json#/$defs/Context" - }, - { - "type": "object", - "properties": { - "action": { - "enum": [ - "on_track" - ] - } - }, - "required": [ - "action" - ] - } - ] - }, - "message": { - "type": "object", - "additionalProperties": false, - "properties": { - "tracking": { - "$ref": "../schema/components.json#/$defs/Tracking" - } - }, - "required": [ - "tracking" - ] - }, - "error": { - "$ref": "../schema/components.json#/$defs/Error" - } - }, - "required": [ - "context", - "message" - ] -} \ No newline at end of file diff --git a/plugins/schema/ondc_trv10/on_cancel.json b/plugins/schema/ondc_trv10/on_cancel.json deleted file mode 100644 index a520787..0000000 --- a/plugins/schema/ondc_trv10/on_cancel.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://ondc.org/trv10/2.0.0/on_cancel", - "type": "object", - "properties": { - "context": { - "allOf": [ - { - "$ref": "../schema/components.json#/$defs/Context" - }, - { - "type": "object", - "properties": { - "action": { - "enum": [ - "on_cancel" - ] - } - }, - "required": [ - "action" - ] - } - ] - }, - "message": { - "type": "object", - "additionalProperties": false, - "properties": { - "order": { - "$ref": "../schema/components.json#/$defs/Order" - } - }, - "required": [ - "order" - ] - }, - "error": { - "$ref": "../schema/components.json#/$defs/Error" - } - }, - "required": [ - "context", - "message" - ] -} \ No newline at end of file diff --git a/plugins/schema/ondc_trv10/on_confirm.json b/plugins/schema/ondc_trv10/on_confirm.json deleted file mode 100644 index f534109..0000000 --- a/plugins/schema/ondc_trv10/on_confirm.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://ondc.org/trv10/2.0.0/on_confirm", - "type": "object", - "properties": { - "context": { - "allOf": [ - { - "$ref": "../schema/components.json#/$defs/Context" - }, - { - "type": "object", - "properties": { - "action": { - "enum": [ - "on_confirm" - ] - } - }, - "required": [ - "action" - ] - } - ] - }, - "message": { - "type": "object", - "additionalProperties": false, - "properties": { - "order": { - "$ref": "../schema/components.json#/$defs/Order" - } - }, - "required": [ - "order" - ] - }, - "error": { - "$ref": "../schema/components.json#/$defs/Error" - } - }, - "required": [ - "context", - "message" - ] -} \ No newline at end of file diff --git a/plugins/schema/ondc_trv10/on_status.json b/plugins/schema/ondc_trv10/on_status.json deleted file mode 100644 index 62d2268..0000000 --- a/plugins/schema/ondc_trv10/on_status.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://ondc.org/trv10/2.0.0/on_status", - "type": "object", - "properties": { - "context": { - "allOf": [ - { - "$ref": "../schema/components.json#/$defs/Context" - }, - { - "type": "object", - "properties": { - "action": { - "enum": [ - "on_status" - ] - } - }, - "required": [ - "action" - ] - } - ] - }, - "message": { - "type": "object", - "additionalProperties": false, - "properties": { - "order": { - "$ref": "../schema/components.json#/$defs/Order" - } - }, - "required": [ - "order" - ] - }, - "error": { - "$ref": "../schema/components.json#/$defs/Error" - } - }, - "required": [ - "context", - "message" - ] -} \ No newline at end of file diff --git a/plugins/schema/ondc_trv10/on_update.json b/plugins/schema/ondc_trv10/on_update.json deleted file mode 100644 index 376bc3b..0000000 --- a/plugins/schema/ondc_trv10/on_update.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://ondc.org/trv10/2.0.0/on_update", - "type": "object", - "properties": { - "context": { - "allOf": [ - { - "$ref": "../schema/components.json#/$defs/Context" - }, - { - "type": "object", - "properties": { - "action": { - "enum": [ - "on_update" - ] - } - }, - "required": [ - "action" - ] - } - ] - }, - "message": { - "type": "object", - "additionalProperties": false, - "properties": { - "order": { - "$ref": "../schema/components.json#/$defs/Order" - } - }, - "required": [ - "order" - ] - }, - "error": { - "$ref": "../schema/components.json#/$defs/Error" - } - }, - "required": [ - "context", - "message" - ] -} \ No newline at end of file diff --git a/plugins/schemas/core/v1.1.0/Cancel.json b/plugins/schemas/core/v1.1.0/Cancel.json new file mode 100644 index 0000000..b09e97a --- /dev/null +++ b/plugins/schemas/core/v1.1.0/Cancel.json @@ -0,0 +1,32 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "cancel", + "type": "object", + "properties": { + "context": { + "allOf": [ + { + "$ref": "definitions.json#/$defs/Context" + }, + { + "type": "object", + "properties": { + "action": { + "enum": [ + "cancel" + ] + } + }, + "required": [ + "action" + ] + } + ] + } + + }, + "required": [ + "message", + "context" + ] +} \ No newline at end of file diff --git a/plugins/schema/beckn_base/api/io/confirm.json b/plugins/schemas/core/v1.1.0/Confirm.json similarity index 79% rename from plugins/schema/beckn_base/api/io/confirm.json rename to plugins/schemas/core/v1.1.0/Confirm.json index 36d6431..96510ba 100644 --- a/plugins/schema/beckn_base/api/io/confirm.json +++ b/plugins/schemas/core/v1.1.0/Confirm.json @@ -1,12 +1,12 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://ondc.org/trv10/2.0.0/confirm", + "$id": "https://beckn.org/schema/confirm", "type": "object", "properties": { "context": { "allOf": [ { - "$ref": "../schema/components.json#/$defs/Context" + "$ref": "definitions.json#/$defs/Context" }, { "type": "object", @@ -28,7 +28,7 @@ "additionalProperties": false, "properties": { "order": { - "$ref": "../schema/components.json#/$defs/Order" + "$ref": "definitions.json#/$defs/Order" } }, "required": [ diff --git a/plugins/schema/beckn_base/api/io/Init.json b/plugins/schemas/core/v1.1.0/Init.json similarity index 79% rename from plugins/schema/beckn_base/api/io/Init.json rename to plugins/schemas/core/v1.1.0/Init.json index 1c8dccf..a13d644 100644 --- a/plugins/schema/beckn_base/api/io/Init.json +++ b/plugins/schemas/core/v1.1.0/Init.json @@ -1,12 +1,12 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://ondc.org/trv10/2.0.0/init", + "$id": "https://beckn.org/schema/init", "type": "object", "properties": { "context": { "allOf": [ { - "$ref": "../schema/components.json#/$defs/Context" + "$ref": "./definitions.json#/$defs/Context" }, { "type": "object", @@ -28,7 +28,7 @@ "additionalProperties": false, "properties": { "order": { - "$ref": "../schema/components.json#/$defs/Order" + "$ref": "./definitions.json#/$defs/Order" } }, "required": [ diff --git a/plugins/schema/beckn_base/api/io/OnCancel.json b/plugins/schemas/core/v1.1.0/OnCancel.json similarity index 78% rename from plugins/schema/beckn_base/api/io/OnCancel.json rename to plugins/schemas/core/v1.1.0/OnCancel.json index 284dcb7..2a6c18d 100644 --- a/plugins/schema/beckn_base/api/io/OnCancel.json +++ b/plugins/schemas/core/v1.1.0/OnCancel.json @@ -6,7 +6,7 @@ "context": { "allOf": [ { - "$ref": "../schema/components.json#/$defs/Context" + "$ref": "./definitions.json#/$defs/Context" }, { "properties": { @@ -26,7 +26,7 @@ "type": "object", "properties": { "order": { - "$ref": "../schema/components.json#/$defs/Order" + "$ref": "./definitions.json#/$defs/Order" } }, "required": [ @@ -34,7 +34,7 @@ ] }, "error": { - "$ref": "../schema/components.json#/$defs/Error" + "$ref": "./definitions.json#/$defs/Error" } }, "required": [ diff --git a/plugins/schema/beckn_base/api/io/OnConfirm.json b/plugins/schemas/core/v1.1.0/OnConfirm.json similarity index 78% rename from plugins/schema/beckn_base/api/io/OnConfirm.json rename to plugins/schemas/core/v1.1.0/OnConfirm.json index d7450df..c0b4d8b 100644 --- a/plugins/schema/beckn_base/api/io/OnConfirm.json +++ b/plugins/schemas/core/v1.1.0/OnConfirm.json @@ -6,7 +6,7 @@ "context": { "allOf": [ { - "$ref": "../schema/components.json#/$defs/Context" + "$ref": "./definitions.json#/$defs/Context" }, { "properties": { @@ -26,7 +26,7 @@ "type": "object", "properties": { "order": { - "$ref": "../schema/components.json#/$defs/Order" + "$ref": "./definitions.json#/$defs/Order" } }, "required": [ @@ -34,7 +34,7 @@ ] }, "error": { - "$ref": "../schema/components.json#/$defs/Error" + "$ref": "./definitions.json#/$defs/Error" } }, "required": [ diff --git a/plugins/schema/beckn_base/api/io/OnInit.json b/plugins/schemas/core/v1.1.0/OnInit.json similarity index 78% rename from plugins/schema/beckn_base/api/io/OnInit.json rename to plugins/schemas/core/v1.1.0/OnInit.json index 2c9a1a4..6092399 100644 --- a/plugins/schema/beckn_base/api/io/OnInit.json +++ b/plugins/schemas/core/v1.1.0/OnInit.json @@ -6,7 +6,7 @@ "context": { "allOf": [ { - "$ref": "../schema/components.json#/$defs/Context" + "$ref": "./definitions.json#/$defs/Context" }, { "properties": { @@ -26,7 +26,7 @@ "type": "object", "properties": { "order": { - "$ref": "../schema/components.json#/$defs/Order" + "$ref": "./definitions.json#/$defs/Order" } }, "required": [ @@ -34,7 +34,7 @@ ] }, "error": { - "$ref": "../schema/components.json#/$defs/Error" + "$ref": "./definitions.json#/$defs/Error" } }, "required": [ diff --git a/plugins/schema/beckn_base/api/io/OnRating.json b/plugins/schemas/core/v1.1.0/OnRating.json similarity index 81% rename from plugins/schema/beckn_base/api/io/OnRating.json rename to plugins/schemas/core/v1.1.0/OnRating.json index bf9c67d..83a0f22 100644 --- a/plugins/schema/beckn_base/api/io/OnRating.json +++ b/plugins/schemas/core/v1.1.0/OnRating.json @@ -6,7 +6,7 @@ "context": { "allOf": [ { - "$ref": "../schema/components.json#/$defs/Context" + "$ref": "./definitions.json#/$defs/Context" }, { "properties": { @@ -29,14 +29,14 @@ "description": "A feedback form to allow the user to provide additional information on the rating provided", "allOf": [ { - "$ref": "../schema/components.json#/$defs/XInput" + "$ref": "./definitions.json#/$defs/XInput" } ] } } }, "error": { - "$ref": "../schema/components.json#/$defs/Error" + "$ref": "./definitions.json#/$defs/Error" } }, "required": [ diff --git a/plugins/schema/beckn_base/api/io/OnSearch.json b/plugins/schemas/core/v1.1.0/OnSearch.json similarity index 78% rename from plugins/schema/beckn_base/api/io/OnSearch.json rename to plugins/schemas/core/v1.1.0/OnSearch.json index bde0ff9..b133a81 100644 --- a/plugins/schema/beckn_base/api/io/OnSearch.json +++ b/plugins/schemas/core/v1.1.0/OnSearch.json @@ -6,7 +6,7 @@ "context": { "allOf": [ { - "$ref": "../schema/components.json#/$defs/Context" + "$ref": "./definitions.json#/$defs/Context" }, { "properties": { @@ -26,7 +26,7 @@ "type": "object", "properties": { "catalog": { - "$ref": "../schema/components.json#/$defs/Catalog" + "$ref": "./definitions.json#/$defs/Catalog" } }, "required": [ @@ -34,7 +34,7 @@ ] }, "error": { - "$ref": "../schema/components.json#/$defs/Error" + "$ref": "./definitions.json#/$defs/Error" } }, "required": [ diff --git a/plugins/schema/beckn_base/api/io/OnSelect.json b/plugins/schemas/core/v1.1.0/OnSelect.json similarity index 77% rename from plugins/schema/beckn_base/api/io/OnSelect.json rename to plugins/schemas/core/v1.1.0/OnSelect.json index 8a9cbc6..1404d31 100644 --- a/plugins/schema/beckn_base/api/io/OnSelect.json +++ b/plugins/schemas/core/v1.1.0/OnSelect.json @@ -6,7 +6,7 @@ "context": { "allOf": [ { - "$ref": "../schema/components.json#/$defs/Context" + "$ref": "./definitions.json#/$defs/Context" }, { "properties": { @@ -26,12 +26,12 @@ "type": "object", "properties": { "order": { - "$ref": "../schema/components.json#/$defs/Order" + "$ref": "./definitions.json#/$defs/Order" } } }, "error": { - "$ref": "../schema/components.json#/$defs/Error" + "$ref": "./definitions.json#/$defs/Error" } }, "required": [ diff --git a/plugins/schema/beckn_base/api/io/OnStatus.json b/plugins/schemas/core/v1.1.0/OnStatus.json similarity index 78% rename from plugins/schema/beckn_base/api/io/OnStatus.json rename to plugins/schemas/core/v1.1.0/OnStatus.json index b450e52..8459e82 100644 --- a/plugins/schema/beckn_base/api/io/OnStatus.json +++ b/plugins/schemas/core/v1.1.0/OnStatus.json @@ -6,7 +6,7 @@ "context": { "allOf": [ { - "$ref": "../schema/components.json#/$defs/Context" + "$ref": "./definitions.json#/$defs/Context" }, { "properties": { @@ -26,7 +26,7 @@ "type": "object", "properties": { "order": { - "$ref": "../schema/components.json#/$defs/Order" + "$ref": "./definitions.json#/$defs/Order" } }, "required": [ @@ -34,7 +34,7 @@ ] }, "error": { - "$ref": "../schema/components.json#/$defs/Error" + "$ref": "./definitions.json#/$defs/Error" } }, "required": [ diff --git a/plugins/schema/beckn_base/api/io/OnSupport.json b/plugins/schemas/core/v1.1.0/OnSupport.json similarity index 77% rename from plugins/schema/beckn_base/api/io/OnSupport.json rename to plugins/schemas/core/v1.1.0/OnSupport.json index 8ec4ed7..226aa3b 100644 --- a/plugins/schema/beckn_base/api/io/OnSupport.json +++ b/plugins/schemas/core/v1.1.0/OnSupport.json @@ -6,7 +6,7 @@ "context": { "allOf": [ { - "$ref": "../schema/components.json#/$defs/Context" + "$ref": "./definitions.json#/$defs/Context" }, { "properties": { @@ -26,12 +26,12 @@ "type": "object", "properties": { "support": { - "$ref": "../schema/components.json#/$defs/Support" + "$ref": "./definitions.json#/$defs/Support" } } }, "error": { - "$ref": "../schema/components.json#/$defs/Error" + "$ref": "./definitions.json#/$defs/Error" } }, "required": [ diff --git a/plugins/schema/beckn_base/api/io/OnTrack.json b/plugins/schemas/core/v1.1.0/OnTrack.json similarity index 78% rename from plugins/schema/beckn_base/api/io/OnTrack.json rename to plugins/schemas/core/v1.1.0/OnTrack.json index 5abaa84..ab06934 100644 --- a/plugins/schema/beckn_base/api/io/OnTrack.json +++ b/plugins/schemas/core/v1.1.0/OnTrack.json @@ -6,7 +6,7 @@ "context": { "allOf": [ { - "$ref": "../schema/components.json#/$defs/Context" + "$ref": "./definitions.json#/$defs/Context" }, { "properties": { @@ -26,7 +26,7 @@ "type": "object", "properties": { "tracking": { - "$ref": "../schema/components.json#/$defs/Tracking" + "$ref": "./definitions.json#/$defs/Tracking" } }, "required": [ @@ -34,7 +34,7 @@ ] }, "error": { - "$ref": "../schema/components.json#/$defs/Error" + "$ref": "./definitions.json#/$defs/Error" } }, "required": [ diff --git a/plugins/schema/beckn_base/api/io/OnUpdate.json b/plugins/schemas/core/v1.1.0/OnUpdate.json similarity index 78% rename from plugins/schema/beckn_base/api/io/OnUpdate.json rename to plugins/schemas/core/v1.1.0/OnUpdate.json index a974a86..53038d1 100644 --- a/plugins/schema/beckn_base/api/io/OnUpdate.json +++ b/plugins/schemas/core/v1.1.0/OnUpdate.json @@ -6,7 +6,7 @@ "context": { "allOf": [ { - "$ref": "../schema/components.json#/$defs/Context" + "$ref": "./definitions.json#/$defs/Context" }, { "properties": { @@ -26,7 +26,7 @@ "type": "object", "properties": { "order": { - "$ref": "../schema/components.json#/$defs/Order" + "$ref": "./definitions.json#/$defs/Order" } }, "required": [ @@ -34,7 +34,7 @@ ] }, "error": { - "$ref": "../schema/components.json#/$defs/Error" + "$ref": "./definitions.json#/$defs/Error" } }, "required": [ diff --git a/plugins/schema/beckn_base/api/io/Rating.json b/plugins/schemas/core/v1.1.0/Rating.json similarity index 78% rename from plugins/schema/beckn_base/api/io/Rating.json rename to plugins/schemas/core/v1.1.0/Rating.json index 43f0391..61bd2f3 100644 --- a/plugins/schema/beckn_base/api/io/Rating.json +++ b/plugins/schemas/core/v1.1.0/Rating.json @@ -1,12 +1,12 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://ondc.org/trv10/2.0.0/rating", + "$id": "https://beckn.org/schema/rating", "type": "object", "properties": { "context": { "allOf": [ { - "$ref": "../schema/components.json#/$defs/Context" + "$ref": "./definitions.json#/$defs/Context" }, { "type": "object", @@ -29,7 +29,7 @@ "ratings": { "type": "array", "items": { - "$ref": "../schema/components.json#/$defs/Rating" + "$ref": "./definitions.json#/$defs/Rating" } } } diff --git a/plugins/schema/beckn_base/api/io/Response.json b/plugins/schemas/core/v1.1.0/Response.json similarity index 100% rename from plugins/schema/beckn_base/api/io/Response.json rename to plugins/schemas/core/v1.1.0/Response.json diff --git a/plugins/schema/beckn_base/api/io/Status.json b/plugins/schemas/core/v1.1.0/Status.json similarity index 74% rename from plugins/schema/beckn_base/api/io/Status.json rename to plugins/schemas/core/v1.1.0/Status.json index 219b48f..4a5947a 100644 --- a/plugins/schema/beckn_base/api/io/Status.json +++ b/plugins/schemas/core/v1.1.0/Status.json @@ -1,12 +1,12 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://ondc.org/trv10/2.0.0/status", + "$id": "https://beckn.org/schema/status", "type": "object", "properties": { "context": { "allOf": [ { - "$ref": "../schema/components.json#/$defs/Context" + "$ref": "./definitions.json#/$defs/Context" }, { "type": "object", @@ -28,10 +28,10 @@ "additionalProperties": false, "properties": { "ref_id": { - "$ref": "../schema/components.json#/$defs/Order" + "$ref": "./definitions.json#/$defs/Order" }, "order_id": { - "$ref": "../schema/components.json#/$defs/Order" + "$ref": "./definitions.json#/$defs/Order" } } } diff --git a/plugins/schema/beckn_base/api/io/Support.json b/plugins/schemas/core/v1.1.0/Support.json similarity index 77% rename from plugins/schema/beckn_base/api/io/Support.json rename to plugins/schemas/core/v1.1.0/Support.json index 962536d..9b39df5 100644 --- a/plugins/schema/beckn_base/api/io/Support.json +++ b/plugins/schemas/core/v1.1.0/Support.json @@ -1,12 +1,12 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://ondc.org/trv10/2.0.0/support", + "$id": "https://beckn.org/schema/support", "type": "object", "properties": { "context": { "allOf": [ { - "$ref": "../schema/components.json#/$defs/Context" + "$ref": "./definitions.json#/$defs/Context" }, { "type": "object", @@ -27,7 +27,7 @@ "type": "object", "properties": { "support": { - "$ref": "../schema/components.json#/$defs/Support" + "$ref": "./definitions.json#/$defs/Support" } } } diff --git a/plugins/schema/beckn_base/api/io/Track.json b/plugins/schemas/core/v1.1.0/Track.json similarity index 81% rename from plugins/schema/beckn_base/api/io/Track.json rename to plugins/schemas/core/v1.1.0/Track.json index eca39d3..5fabb7e 100644 --- a/plugins/schema/beckn_base/api/io/Track.json +++ b/plugins/schemas/core/v1.1.0/Track.json @@ -1,12 +1,12 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://ondc.org/trv10/2.0.0/track", + "$id": "https://beckn.org/schema/track", "type": "object", "properties": { "context": { "allOf": [ { - "$ref": "../schema/components.json#/$defs/Context" + "$ref": "./definitions.json#/$defs/Context" }, { "type": "object", @@ -28,7 +28,7 @@ "additionalProperties": false, "properties": { "order_id": { - "$ref": "../schema/components.json#/$defs/Order" + "$ref": "./definitions.json#/$defs/Order" }, "callback_url": { "type": "string", diff --git a/plugins/schema/beckn_base/api/io/Update.json b/plugins/schemas/core/v1.1.0/Update.json similarity index 85% rename from plugins/schema/beckn_base/api/io/Update.json rename to plugins/schemas/core/v1.1.0/Update.json index d8fd349..dda31f4 100644 --- a/plugins/schema/beckn_base/api/io/Update.json +++ b/plugins/schemas/core/v1.1.0/Update.json @@ -1,12 +1,12 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://ondc.org/trv10/2.0.0/update", + "$id": "https://beckn.org/schema/update", "type": "object", "properties": { "context": { "allOf": [ { - "$ref": "../schema/components.json#/$defs/Context" + "$ref": "./definitions.json#/$defs/Context" }, { "type": "object", @@ -35,7 +35,7 @@ "description": "Updated order object", "allOf": [ { - "$ref": "../schema/components.json#/$defs/Order" + "$ref": "./definitions.json#/$defs/Order" } ] } diff --git a/plugins/schema/beckn_base/api/schema/components.json b/plugins/schemas/core/v1.1.0/definitions.json similarity index 98% rename from plugins/schema/beckn_base/api/schema/components.json rename to plugins/schemas/core/v1.1.0/definitions.json index ce94b89..4c82c20 100644 --- a/plugins/schema/beckn_base/api/schema/components.json +++ b/plugins/schemas/core/v1.1.0/definitions.json @@ -1,9 +1,9 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://beckn.org/schema/components", + "$id": "definitions.json", "$defs": { "Ack": { - "$id": "#Ack", + "$id": "Ack", "description": "Describes the acknowledgement sent in response to an API call. If the implementation uses HTTP/S, then Ack must be returned in the same session. Every API call to a BPP must be responded to with an Ack whether the BPP intends to respond with a callback or not. This has one property called `status` that indicates the status of the Acknowledgement.", "type": "object", "additionalProperties": false, @@ -26,7 +26,7 @@ } }, "AddOn": { - "$id": "#AddOn", + "$id": "AddOn", "description": "Describes an additional item offered as a value-addition to a product or service. This does not exist independently in a catalog and is always associated with an item.", "type": "object", "additionalProperties": false, @@ -47,12 +47,12 @@ } }, "Address": { - "$id": "#Address", + "$id": "Address", "description": "Describes a postal address.", "type": "string" }, "Agent": { - "$id": "#Agent", + "$id": "Agent", "description": "Describes the direct performer, driver or executor that fulfills an order. It is usually a person. But in some rare cases, it could be a non-living entity like a drone, or a bot. Some examples of agents are Doctor in the healthcare sector, a driver in the mobility sector, or a delivery person in the logistics sector. This object can be set at any stage of the order lifecycle. This can be set at the discovery stage when the BPP wants to provide details on the agent fulfilling the order, like in healthcare, where the doctor's name appears during search. This object can also used to search for a particular person that the customer wants fulfilling an order. Sometimes, this object gets instantiated after the order is confirmed, like in the case of on-demand taxis, where the driver is assigned after the user confirms the ride.", "type": "object", "additionalProperties": false, @@ -72,7 +72,7 @@ } }, "Authorization": { - "$id": "#Authorization", + "$id": "Authorization", "description": "Describes an authorization mechanism used to start or end the fulfillment of an order. For example, in the mobility sector, the driver may require a one-time password to initiate the ride. In the healthcare sector, a patient may need to provide a password to open a video conference link during a teleconsultation.", "type": "object", "additionalProperties": false, @@ -102,7 +102,7 @@ } }, "Billing": { - "$id": "#Billing", + "$id": "Billing", "description": "Describes the billing details of an entity.
This has properties like name,organization,address,email,phone,time,tax_number, created_at,updated_at", "type": "object", "additionalProperties": false, @@ -167,7 +167,7 @@ } }, "Cancellation": { - "$id": "#Cancellation", + "$id": "Cancellation", "description": "Describes a cancellation event", "type": "object", "additionalProperties": false, @@ -203,7 +203,7 @@ } }, "CancellationTerm": { - "$id": "#CancellationTerm", + "$id": "CancellationTerm", "description": "Describes the cancellation terms of an item or an order. This can be referenced at an item or order level. Item-level cancellation terms can override the terms at the order level.", "type": "object", "additionalProperties": false, @@ -240,7 +240,7 @@ } }, "Catalog": { - "$id": "#Catalog", + "$id": "Catalog", "description": "Describes the products or services offered by a BPP. This is typically sent as the response to a search intent from a BAP. The payment terms, offers and terms of fulfillment supported by the BPP can also be included here. The BPP can show hierarchical nature of products/services in its catalog using the parent_category_id in categories. The BPP can also send a ttl (time to live) in the context which is the duration for which a BAP can cache the catalog and use the cached catalog.
This has properties like bbp/descriptor,bbp/categories,bbp/fulfillments,bbp/payments,bbp/offers,bbp/providers and exp
This is used in the following situations.
", "type": "object", "additionalProperties": false, @@ -287,7 +287,7 @@ } }, "Category": { - "$id": "#Category", + "$id": "Category", "description": "A label under which a collection of items can be grouped.", "type": "object", "additionalProperties": false, @@ -317,7 +317,7 @@ } }, "Circle": { - "$id": "#Circle", + "$id": "Circle", "description": "Describes a circular region of a specified radius centered at a specified GPS coordinate.", "type": "object", "additionalProperties": false, @@ -331,7 +331,7 @@ } }, "City": { - "$id": "#City", + "$id": "City", "description": "Describes a city", "type": "object", "additionalProperties": false, @@ -347,7 +347,7 @@ } }, "Contact": { - "$id": "#Contact", + "$id": "Contact", "description": "Describes the contact information of an entity", "type": "object", "additionalProperties": false, @@ -366,7 +366,7 @@ } }, "Context": { - "$id": "#Context", + "$id": "Context", "description": "Every API call in beckn protocol has a context. It provides a high-level overview to the receiver about the nature of the intended transaction. Typically, it is the BAP that sets the transaction context based on the consumer's location and action on their UI. But sometimes, during unsolicited callbacks, the BPP also sets the transaction context but it is usually the same as the context of a previous full-cycle, request-callback interaction between the BAP and the BPP. The context object contains four types of fields.
  1. Demographic information about the transaction using fields like `domain`, `country`, and `region`.
  2. Addressing details like the sending and receiving platform's ID and API URL.
  3. Interoperability information like the protocol version that implemented by the sender and,
  4. Transaction details like the method being called at the receiver's endpoint, the transaction_id that represents an end-to-end user session at the BAP, a message ID to pair requests with callbacks, a timestamp to capture sending times, a ttl to specifiy the validity of the request, and a key to encrypt information if necessary.
This object must be passed in every interaction between a BAP and a BPP. In HTTP/S implementations, it is not necessary to send the context during the synchronous response. However, in asynchronous protocols, the context must be sent during all interactions,", "type": "object", "additionalProperties": false, @@ -457,7 +457,7 @@ } }, "Country": { - "$id": "#Country", + "$id": "Country", "description": "Describes a country", "type": "object", "additionalProperties": false, @@ -473,7 +473,7 @@ } }, "Credential": { - "$id": "#Credential", + "$id": "Credential", "description": "Describes a credential of an entity - Person or Organization", "type": "object", "additionalProperties": false, @@ -493,7 +493,7 @@ } }, "Customer": { - "$id": "#Customer", + "$id": "Customer", "description": "Describes a customer buying/availing a product or a service", "type": "object", "additionalProperties": false, @@ -507,13 +507,13 @@ } }, "DecimalValue": { - "$id": "#DecimalValue", + "$id": "DecimalValue", "description": "Describes a numerical value in decimal form", "type": "string", "pattern": "[+-]?([0-9]*[.])?[0-9]+" }, "Descriptor": { - "$id": "#Descriptor", + "$id": "Descriptor", "description": "Physical description of something.", "type": "object", "additionalProperties": false, @@ -562,7 +562,7 @@ } }, "Domain": { - "$id": "#Domain", + "$id": "Domain", "description": "Described the industry sector or sub-sector. The network policy should contain codes for all the industry sectors supported by the network. Domains can be created in varying levels of granularity. The granularity of a domain can be decided by the participants of the network. Too broad domains will result in irrelevant search broadcast calls to BPPs that don't have services supporting the domain. Too narrow domains will result in a large number of registry entries for each BPP. It is recommended that network facilitators actively collaborate with various working groups and network participants to carefully choose domain codes keeping in mind relevance, performance, and opportunity cost. It is recommended that networks choose broad domains like mobility, logistics, healthcare etc, and progressively granularize them as and when the number of network participants for each domain grows large.", "type": "object", "additionalProperties": false, @@ -585,12 +585,12 @@ } }, "Duration": { - "$id": "#Duration", + "$id": "Duration", "description": "Describes duration as per ISO8601 format", "type": "string" }, "Error": { - "$id": "#Error", + "$id": "Error", "description": "Describes an error object that is returned by a BAP, BPP or BG as a response or callback to an action by another network participant. This object is sent when any request received by a network participant is unacceptable. This object can be sent either during Ack or with the callback.", "type": "object", "additionalProperties": false, @@ -610,7 +610,7 @@ } }, "Fee": { - "$id": "#Fee", + "$id": "Fee", "description": "A fee applied on a particular entity", "type": "object", "additionalProperties": false, @@ -634,7 +634,7 @@ } }, "Form": { - "$id": "#Form", + "$id": "Form", "description": "Describes a form", "type": "object", "additionalProperties": false, @@ -673,7 +673,7 @@ } }, "Fulfillment": { - "$id": "#Fulfillment", + "$id": "Fulfillment", "description": "Describes how a an order will be rendered/fulfilled to the end-customer", "type": "object", "additionalProperties": false, @@ -753,7 +753,7 @@ } }, "FulfillmentState": { - "$id": "#FulfillmentState", + "$id": "FulfillmentState", "description": "Describes the state of fulfillment", "type": "object", "additionalProperties": false, @@ -772,13 +772,13 @@ } }, "Gps": { - "$id": "#Gps", + "$id": "Gps", "description": "Describes a GPS coordinate", "type": "string", "pattern": "^[-+]?([1-8]?\\d(\\.\\d+)?|90(\\.0+)?),\\s*[-+]?(180(\\.0+)?|((1[0-7]\\d)|([1-9]?\\d))(\\.\\d+)?)$" }, "Image": { - "$id": "#Image", + "$id": "Image", "description": "Describes an image", "type": "object", "additionalProperties": false, @@ -811,7 +811,7 @@ } }, "Intent": { - "$id": "#Intent", + "$id": "Intent", "description": "The intent to buy or avail a product or a service. The BAP can declare the intent of the consumer containing
This has properties like descriptor,provider,fulfillment,payment,category,offer,item,tags
This is typically used by the BAP to send the purpose of the user's search to the BPP. This will be used by the BPP to find products or services it offers that may match the user's intent.
For example, in Mobility, the mobility consumer declares a mobility intent. In this case, the mobility consumer declares information that describes various aspects of their journey like,
For example, in health domain, a consumer declares the intent for a lab booking the describes various aspects of their booking like,", "type": "object", "additionalProperties": false, @@ -881,7 +881,7 @@ } }, "ItemQuantity": { - "$id": "#ItemQuantity", + "$id": "ItemQuantity", "description": "Describes the count or amount of an item", "type": "object", "additionalProperties": false, @@ -974,7 +974,7 @@ } }, "Item": { - "$id": "#Item", + "$id": "Item", "description": "Describes a product or a service offered to the end consumer by the provider. In the mobility sector, it can represent a fare product like one way journey. In the logistics sector, it can represent the delivery service offering. In the retail domain it can represent a product like a grocery item.", "type": "object", "additionalProperties": false, @@ -1189,7 +1189,7 @@ } }, "Location": { - "$id": "#Location", + "$id": "Location", "description": "The physical location of something", "type": "object", "additionalProperties": false, @@ -1278,7 +1278,7 @@ } }, "MediaFile": { - "$id": "#MediaFile", + "$id": "MediaFile", "description": "This object contains a url to a media file.", "type": "object", "additionalProperties": false, @@ -1303,7 +1303,7 @@ } }, "Offer": { - "$id": "#Offer", + "$id": "Offer", "description": "An offer associated with a catalog. This is typically used to promote a particular product and enable more purchases.", "type": "object", "additionalProperties": false, @@ -1344,7 +1344,7 @@ } }, "Option": { - "$id": "#Option", + "$id": "Option", "description": "Describes a selectable option", "type": "object", "additionalProperties": false, @@ -1358,7 +1358,7 @@ } }, "Order": { - "$id": "#Order", + "$id": "Order", "description": "Describes a legal purchase order. It contains the complete details of the legal contract created between the buyer and the seller.", "type": "object", "additionalProperties": false, @@ -1545,7 +1545,7 @@ } }, "Organization": { - "$id": "#Organization", + "$id": "Organization", "description": "An organization. Usually a recognized business entity.", "type": "object", "additionalProperties": false, @@ -1583,7 +1583,7 @@ } }, "Payment": { - "$id": "#Payment", + "$id": "Payment", "description": "Describes the terms of settlement between the BAP and the BPP for a single transaction. When instantiated, this object contains
  1. the amount that has to be settled,
  2. The payment destination destination details
  3. When the settlement should happen, and
  4. A transaction reference ID
. During a transaction, the BPP reserves the right to decide the terms of payment. However, the BAP can send its terms to the BPP first. If the BPP does not agree to those terms, it must overwrite the terms and return them to the BAP. If overridden, the BAP must either agree to the terms sent by the BPP in order to preserve the provider's autonomy, or abort the transaction. In case of such disagreements, the BAP and the BPP can perform offline negotiations on the payment terms. Once an agreement is reached, the BAP and BPP can resume transactions.", "type": "object", "additionalProperties": false, @@ -1668,7 +1668,7 @@ } }, "Person": { - "$id": "#Person", + "$id": "Person", "description": "Describes a person as any individual", "type": "object", "additionalProperties": false, @@ -1753,7 +1753,7 @@ } }, "Price": { - "$id": "#Price", + "$id": "Price", "description": "Describes the price of a product or service", "type": "object", "additionalProperties": false, @@ -1785,7 +1785,7 @@ } }, "Provider": { - "$id": "#Provider", + "$id": "Provider", "description": "Describes the catalog of a business.", "type": "object", "additionalProperties": false, @@ -1865,7 +1865,7 @@ } }, "Quotation": { - "$id": "#Quotation", + "$id": "Quotation", "description": "Describes a quote. It is the estimated price of products or services from the BPP.
This has properties like price, breakup, ttl", "type": "object", "additionalProperties": false, @@ -1908,7 +1908,7 @@ } }, "Rating": { - "$id": "#Rating", + "$id": "Rating", "description": "Describes the rating of an entity", "type": "object", "additionalProperties": false, @@ -1936,7 +1936,7 @@ } }, "Region": { - "$id": "#Region", + "$id": "Region", "description": "Describes an arbitrary region of space. The network policy should contain a published list of supported regions by the network.", "type": "object", "additionalProperties": false, @@ -1973,7 +1973,7 @@ } }, "ReplacementTerm": { - "$id": "#ReplacementTerm", + "$id": "ReplacementTerm", "description": "The replacement policy of an item or an order", "type": "object", "additionalProperties": false, @@ -2000,7 +2000,7 @@ } }, "ReturnTerm": { - "$id": "#ReturnTerm", + "$id": "ReturnTerm", "description": "Describes the return policy of an item or an order", "type": "object", "additionalProperties": false, @@ -2044,7 +2044,7 @@ } }, "Scalar": { - "$id": "#Scalar", + "$id": "Scalar", "description": "Describes a scalar", "type": "object", "additionalProperties": false, @@ -2083,7 +2083,7 @@ } }, "Schedule": { - "$id": "#Schedule", + "$id": "Schedule", "description": "Describes schedule as a repeating time period used to describe a regularly recurring event. At a minimum a schedule will specify frequency which describes the interval between occurrences of the event. Additional information can be provided to specify the schedule more precisely. This includes identifying the timestamps(s) of when the event will take place. Schedules may also have holidays to exclude a specific day from the schedule.
This has properties like frequency, holidays, times", "type": "object", "additionalProperties": false, @@ -2108,7 +2108,7 @@ } }, "State": { - "$id": "#State", + "$id": "State", "description": "A bounded geopolitical region of governance inside a country.", "type": "object", "additionalProperties": false, @@ -2124,7 +2124,7 @@ } }, "Stop": { - "$id": "#Stop", + "$id": "Stop", "description": "A logical point in space and time during the fulfillment of an order.", "type": "object", "additionalProperties": false, @@ -2185,7 +2185,7 @@ } }, "Support": { - "$id": "#Support", + "$id": "Support", "description": "Details of customer support", "type": "object", "additionalProperties": false, @@ -2212,7 +2212,7 @@ } }, "Tag": { - "$id": "#Tag", + "$id": "Tag", "description": "Describes a tag. This is used to contain extended metadata. This object can be added as a property to any schema to describe extended attributes. For BAPs, tags can be sent during search to optimize and filter search results. BPPs can use tags to index their catalog to allow better search functionality. Tags are sent by the BPP as part of the catalog response in the `on_search` callback. Tags are also meant for display purposes. Upon receiving a tag, BAPs are meant to render them as name-value pairs. This is particularly useful when rendering tabular information about a product or service.", "type": "object", "additionalProperties": false, @@ -2236,7 +2236,7 @@ } }, "TagGroup": { - "$id": "#TagGroup", + "$id": "TagGroup", "description": "A collection of tag objects with group level attributes. For detailed documentation on the Tags and Tag Groups schema go to https://github.com/beckn/protocol-specifications/discussions/316", "type": "object", "additionalProperties": false, @@ -2264,7 +2264,7 @@ } }, "Time": { - "$id": "#Time", + "$id": "Time", "description": "Describes time in its various forms. It can be a single point in time; duration; or a structured timetable of operations
This has properties like label, time stamp,duration,range, days, schedule", "type": "object", "additionalProperties": false, @@ -2303,7 +2303,7 @@ } }, "Tracking": { - "$id": "#Tracking", + "$id": "Tracking", "description": "Contains tracking information that can be used by the BAP to track the fulfillment of an order in real-time. which is useful for knowing the location of time sensitive deliveries.", "type": "object", "additionalProperties": false, @@ -2336,7 +2336,7 @@ } }, "Vehicle": { - "$id": "#Vehicle", + "$id": "Vehicle", "description": "Describes a vehicle is a device that is designed or used to transport people or cargo over land, water, air, or through space.
This has properties like category, capacity, make, model, size,variant,color,energy_type,registration", "type": "object", "additionalProperties": false, @@ -2386,7 +2386,7 @@ } }, "XInput": { - "$id": "#XInput", + "$id": "XInput", "description": "Contains any additional or extended inputs required to confirm an order. This is typically a Form Input. Sometimes, selection of catalog elements is not enough for the BPP to confirm an order. For example, to confirm a flight ticket, the airline requires details of the passengers along with information on baggage, identity, in addition to the class of ticket. Similarly, a logistics company may require details on the nature of shipment in order to confirm the shipping. A recruiting firm may require additional details on the applicant in order to confirm a job application. For all such purposes, the BPP can choose to send this object attached to any object in the catalog that is required to be sent while placing the order. This object can typically be sent at an item level or at the order level. The item level XInput will override the Order level XInput as it indicates a special requirement of information for that particular item. Hence the BAP must render a separate form for the Item and another form at the Order level before confirmation.", "type": "object", "additionalProperties": false, diff --git a/plugins/schema/beckn_base/api/io/on_cancel.json b/plugins/schemas/core/v1.1.0/on_cancel.json similarity index 75% rename from plugins/schema/beckn_base/api/io/on_cancel.json rename to plugins/schemas/core/v1.1.0/on_cancel.json index a520787..5dc56b4 100644 --- a/plugins/schema/beckn_base/api/io/on_cancel.json +++ b/plugins/schemas/core/v1.1.0/on_cancel.json @@ -1,12 +1,12 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://ondc.org/trv10/2.0.0/on_cancel", + "$id": "https://beckn.org/schema/on_cancel", "type": "object", "properties": { "context": { "allOf": [ { - "$ref": "../schema/components.json#/$defs/Context" + "$ref": "./definitions.json#/$defs/Context" }, { "type": "object", @@ -28,7 +28,7 @@ "additionalProperties": false, "properties": { "order": { - "$ref": "../schema/components.json#/$defs/Order" + "$ref": "./definitions.json#/$defs/Order" } }, "required": [ @@ -36,7 +36,7 @@ ] }, "error": { - "$ref": "../schema/components.json#/$defs/Error" + "$ref": "./definitions.json#/$defs/Error" } }, "required": [ diff --git a/plugins/schema/beckn_base/api/io/on_confirm.json b/plugins/schemas/core/v1.1.0/on_confirm.json similarity index 75% rename from plugins/schema/beckn_base/api/io/on_confirm.json rename to plugins/schemas/core/v1.1.0/on_confirm.json index a2b67dd..6d5a7e9 100644 --- a/plugins/schema/beckn_base/api/io/on_confirm.json +++ b/plugins/schemas/core/v1.1.0/on_confirm.json @@ -1,12 +1,12 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://ondc.org/trv10/2.0.0/on_confirm", + "$id": "https://beckn.org/schema/on_confirm", "type": "object", "properties": { "context": { "allOf": [ { - "$ref": "../schema/components.json#/$defs/Context" + "$ref": "./definitions.json#/$defs/Context" }, { "type": "object", @@ -28,7 +28,7 @@ "additionalProperties": false, "properties": { "order": { - "$ref": "../schema/components.json#/$defs/Order" + "$ref": "./definitions.json#/$defs/Order" } }, "required": [ @@ -36,7 +36,7 @@ ] }, "error": { - "$ref": "../schema/components.json#/$defs/Error" + "$ref": "./definitions.json#/$defs/Error" } }, "required": [ diff --git a/plugins/schema/beckn_base/api/io/on_init.json b/plugins/schemas/core/v1.1.0/on_init.json similarity index 75% rename from plugins/schema/beckn_base/api/io/on_init.json rename to plugins/schemas/core/v1.1.0/on_init.json index d8c3230..44446b4 100644 --- a/plugins/schema/beckn_base/api/io/on_init.json +++ b/plugins/schemas/core/v1.1.0/on_init.json @@ -1,12 +1,12 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://ondc.org/trv10/2.0.0/on_init", + "$id": "https://beckn.org/schema/on_init", "type": "object", "properties": { "context": { "allOf": [ { - "$ref": "../schema/components.json#/$defs/Context" + "$ref": "./definitions.json#/$defs/Context" }, { "type": "object", @@ -28,7 +28,7 @@ "additionalProperties": false, "properties": { "order": { - "$ref": "../schema/components.json#/$defs/Order" + "$ref": "./definitions.json#/$defs/Order" } }, "required": [ @@ -36,7 +36,7 @@ ] }, "error": { - "$ref": "../schema/components.json#/$defs/Error" + "$ref": "./definitions.json#/$defs/Error" } }, "required": [ diff --git a/plugins/schema/ondc_trv10/on_rating.json b/plugins/schemas/core/v1.1.0/on_rating.json similarity index 77% rename from plugins/schema/ondc_trv10/on_rating.json rename to plugins/schemas/core/v1.1.0/on_rating.json index 8202a00..860dc7b 100644 --- a/plugins/schema/ondc_trv10/on_rating.json +++ b/plugins/schemas/core/v1.1.0/on_rating.json @@ -1,12 +1,12 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://ondc.org/trv10/2.0.0/on_rating", + "$id": "https://beckn.org/schema/on_rating", "type": "object", "properties": { "context": { "allOf": [ { - "$ref": "../schema/components.json#/$defs/Context" + "$ref": "./definitions.json#/$defs/Context" }, { "type": "object", @@ -30,14 +30,14 @@ "description": "A feedback form to allow the user to provide additional information on the rating provided", "allOf": [ { - "$ref": "../schema/components.json#/$defs/XInput" + "$ref": "./definitions.json#/$defs/XInput" } ] } } }, "error": { - "$ref": "../schema/components.json#/$defs/Error" + "$ref": "./definitions.json#/$defs/Error" } }, "required": [ diff --git a/plugins/schema/beckn_base/api/io/on_search.json b/plugins/schemas/core/v1.1.0/on_search.json similarity index 75% rename from plugins/schema/beckn_base/api/io/on_search.json rename to plugins/schemas/core/v1.1.0/on_search.json index 65ec460..31c9649 100644 --- a/plugins/schema/beckn_base/api/io/on_search.json +++ b/plugins/schemas/core/v1.1.0/on_search.json @@ -1,12 +1,12 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://ondc.org/trv10/2.0.0/on_search", + "$id": "https://beckn.org/schema/on_search", "type": "object", "properties": { "context": { "allOf": [ { - "$ref": "../schema/components.json#/$defs/Context" + "$ref": "./definitions.json#/$defs/Context" }, { "type": "object", @@ -28,7 +28,7 @@ "additionalProperties": false, "properties": { "catalog": { - "$ref": "../schema/components.json#/$defs/Catalog" + "$ref": "./definitions.json#/$defs/Catalog" } }, "required": [ @@ -36,7 +36,7 @@ ] }, "error": { - "$ref": "../schema/components.json#/$defs/Error" + "$ref": "./definitions.json#/$defs/Error" } }, "required": [ diff --git a/plugins/schema/beckn_base/api/io/on_select.json b/plugins/schemas/core/v1.1.0/on_select.json similarity index 73% rename from plugins/schema/beckn_base/api/io/on_select.json rename to plugins/schemas/core/v1.1.0/on_select.json index f38bbab..bfd9875 100644 --- a/plugins/schema/beckn_base/api/io/on_select.json +++ b/plugins/schemas/core/v1.1.0/on_select.json @@ -1,12 +1,12 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://ondc.org/trv10/2.0.0/on_select", + "$id": "https://beckn.org/schema/on_select", "type": "object", "properties": { "context": { "allOf": [ { - "$ref": "../schema/components.json#/$defs/Context" + "$ref": "./definitions.json#/$defs/Context" }, { "type": "object", @@ -28,12 +28,12 @@ "additionalProperties": false, "properties": { "order": { - "$ref": "../schema/components.json#/$defs/Order" + "$ref": "./definitions.json#/$defs/Order" } } }, "error": { - "$ref": "../schema/components.json#/$defs/Error" + "$ref": "./definitions.json#/$defs/Error" } }, "required": [ diff --git a/plugins/schema/beckn_base/api/io/on_status.json b/plugins/schemas/core/v1.1.0/on_status.json similarity index 75% rename from plugins/schema/beckn_base/api/io/on_status.json rename to plugins/schemas/core/v1.1.0/on_status.json index 2d06e00..a932177 100644 --- a/plugins/schema/beckn_base/api/io/on_status.json +++ b/plugins/schemas/core/v1.1.0/on_status.json @@ -1,12 +1,12 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://ondc.org/trv10/2.0.0/on_status", + "$id": "https://beckn.org/schema/on_status", "type": "object", "properties": { "context": { "allOf": [ { - "$ref": "../schema/components.json#/$defs/Context" + "$ref": "./definitions.json#/$defs/Context" }, { "type": "object", @@ -28,7 +28,7 @@ "additionalProperties": false, "properties": { "order": { - "$ref": "../schema/components.json#/$defs/Order" + "$ref": "./definitions.json#/$defs/Order" } }, "required": [ @@ -36,7 +36,7 @@ ] }, "error": { - "$ref": "../schema/components.json#/$defs/Error" + "$ref": "./definitions.json#/$defs/Error" } }, "required": [ diff --git a/plugins/schema/ondc_trv10/on_support.json b/plugins/schemas/core/v1.1.0/on_support.json similarity index 72% rename from plugins/schema/ondc_trv10/on_support.json rename to plugins/schemas/core/v1.1.0/on_support.json index a35cef6..84d9742 100644 --- a/plugins/schema/ondc_trv10/on_support.json +++ b/plugins/schemas/core/v1.1.0/on_support.json @@ -1,12 +1,12 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://ondc.org/trv10/2.0.0/on_support", + "$id": "https://beckn.org/schema/on_support", "type": "object", "properties": { "context": { "allOf": [ { - "$ref": "../schema/components.json#/$defs/Context" + "$ref": "./definitions.json#/$defs/Context" }, { "type": "object", @@ -27,12 +27,12 @@ "type": "object", "properties": { "support": { - "$ref": "../schema/components.json#/$defs/Support" + "$ref": "./definitions.json#/$defs/Support" } } }, "error": { - "$ref": "../schema/components.json#/$defs/Error" + "$ref": "./definitions.json#/$defs/Error" } }, "required": [ diff --git a/plugins/schema/ondc_trv10/on_track.json b/plugins/schemas/core/v1.1.0/on_track.json similarity index 75% rename from plugins/schema/ondc_trv10/on_track.json rename to plugins/schemas/core/v1.1.0/on_track.json index 5cccf25..fb9f234 100644 --- a/plugins/schema/ondc_trv10/on_track.json +++ b/plugins/schemas/core/v1.1.0/on_track.json @@ -1,12 +1,12 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://ondc.org/trv10/2.0.0/on_track", + "$id": "https://beckn.org/schema/on_track", "type": "object", "properties": { "context": { "allOf": [ { - "$ref": "../schema/components.json#/$defs/Context" + "$ref": "./definitions.json#/$defs/Context" }, { "type": "object", @@ -28,7 +28,7 @@ "additionalProperties": false, "properties": { "tracking": { - "$ref": "../schema/components.json#/$defs/Tracking" + "$ref": "./definitions.json#/$defs/Tracking" } }, "required": [ @@ -36,7 +36,7 @@ ] }, "error": { - "$ref": "../schema/components.json#/$defs/Error" + "$ref": "./definitions.json#/$defs/Error" } }, "required": [ diff --git a/plugins/schema/beckn_base/api/io/on_update.json b/plugins/schemas/core/v1.1.0/on_update.json similarity index 75% rename from plugins/schema/beckn_base/api/io/on_update.json rename to plugins/schemas/core/v1.1.0/on_update.json index c597087..9285b16 100644 --- a/plugins/schema/beckn_base/api/io/on_update.json +++ b/plugins/schemas/core/v1.1.0/on_update.json @@ -1,12 +1,12 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://ondc.org/trv10/2.0.0/on_update", + "$id": "https://beckn.org/schema/on_update", "type": "object", "properties": { "context": { "allOf": [ { - "$ref": "../schema/components.json#/$defs/Context" + "$ref": "./definitions.json#/$defs/Context" }, { "type": "object", @@ -28,7 +28,7 @@ "additionalProperties": false, "properties": { "order": { - "$ref": "../schema/components.json#/$defs/Order" + "$ref": "./definitions.json#/$defs/Order" } }, "required": [ @@ -36,7 +36,7 @@ ] }, "error": { - "$ref": "../schema/components.json#/$defs/Error" + "$ref": "./definitions.json#/$defs/Error" } }, "required": [ diff --git a/plugins/schema/beckn_base/api/io/search.json b/plugins/schemas/core/v1.1.0/search.json similarity index 66% rename from plugins/schema/beckn_base/api/io/search.json rename to plugins/schemas/core/v1.1.0/search.json index 283bbf0..62dbe5a 100644 --- a/plugins/schema/beckn_base/api/io/search.json +++ b/plugins/schemas/core/v1.1.0/search.json @@ -1,19 +1,19 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://ondc.org/trv10/2.0.0/search", + "$id": "https://beckn.org/schema/search", "type": "object", "properties": { "context": { "allOf": [ { - "$ref": "../schema/components.json#/$defs/Context" + "$ref": "./definitions.json#/$defs/Context" } ] }, "message": { "properties": { "intent": { - "$ref": "../schema/components.json#/$defs/Intent" + "$ref": "./definitions.json#/$defs/Intent" } }, "type": "object" diff --git a/plugins/schema/beckn_base/api/io/select.json b/plugins/schemas/core/v1.1.0/select.json similarity index 79% rename from plugins/schema/beckn_base/api/io/select.json rename to plugins/schemas/core/v1.1.0/select.json index 383c940..73fd3e1 100644 --- a/plugins/schema/beckn_base/api/io/select.json +++ b/plugins/schemas/core/v1.1.0/select.json @@ -1,12 +1,12 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://ondc.org/trv10/2.0.0/select", + "$id": "https://beckn.org/schema/select", "type": "object", "properties": { "context": { "allOf": [ { - "$ref": "../schema/components.json#/$defs/Context" + "$ref": "./definitions.json#/$defs/Context" }, { "type": "object", @@ -28,7 +28,7 @@ "additionalProperties": false, "properties": { "order": { - "$ref": "../schema/components.json#/$defs/Order" + "$ref": "./definitions.json#/$defs/Order" } }, "required": [ diff --git a/plugins/schema/ondc_trv10/cancel.json b/plugins/schemas/ondc_trv10/v2.0.0/cancel.json similarity index 95% rename from plugins/schema/ondc_trv10/cancel.json rename to plugins/schemas/ondc_trv10/v2.0.0/cancel.json index e994a79..ba0a40b 100644 --- a/plugins/schema/ondc_trv10/cancel.json +++ b/plugins/schemas/ondc_trv10/v2.0.0/cancel.json @@ -4,7 +4,7 @@ "type": "object", "allOf": [ { - "$ref": "../beckn_base/api/io/cancel.json#" + "$ref": "../core/v1.1.0/cancel.json#" }, { "$ref": "https://beckn.org/schema/cancel#" diff --git a/plugins/schema/ondc_trv10/confirm.json b/plugins/schemas/ondc_trv10/v2.0.0/confirm.json similarity index 99% rename from plugins/schema/ondc_trv10/confirm.json rename to plugins/schemas/ondc_trv10/v2.0.0/confirm.json index ea6807c..7cfaf2e 100644 --- a/plugins/schema/ondc_trv10/confirm.json +++ b/plugins/schemas/ondc_trv10/v2.0.0/confirm.json @@ -4,7 +4,7 @@ "type": "object", "allOf": [ { - "$ref": "../beckn_base/api/io/confirm.json#" + "$ref": "../core/v1.1.0/confirm.json#" }, { "$ref": "https://beckn.org/schema/confirm#" diff --git a/plugins/schema/ondc_trv10/init.json b/plugins/schemas/ondc_trv10/v2.0.0/init.json similarity index 99% rename from plugins/schema/ondc_trv10/init.json rename to plugins/schemas/ondc_trv10/v2.0.0/init.json index d0a121d..d5b18db 100644 --- a/plugins/schema/ondc_trv10/init.json +++ b/plugins/schemas/ondc_trv10/v2.0.0/init.json @@ -3,7 +3,7 @@ "$id": "https://ondc.org/trv10/2.0.0/init", "type": "object", "allOf": [ - { "$ref": "../beckn_base/api/io/init.json#" }, + { "$ref": "../core/v1.1.0/init.json#" }, { "$ref": "https://beckn.org/schema/init#" }, { "allOf": [ diff --git a/plugins/schemas/ondc_trv10/v2.0.0/on_cancel.json b/plugins/schemas/ondc_trv10/v2.0.0/on_cancel.json new file mode 100644 index 0000000..d83da6f --- /dev/null +++ b/plugins/schemas/ondc_trv10/v2.0.0/on_cancel.json @@ -0,0 +1,16 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://ondc.org/trv10/2.0.0/on_cancel", + "type": "object", + "allOf": [ + { + "$ref": "../core/v1.1.0/confirm.json#" + }, + { + "$ref": "https://beckn.org/schema/confirm#" + }, + { + "$ref": "./init.json#/allOf/2" + } + ] +} \ No newline at end of file diff --git a/plugins/schemas/ondc_trv10/v2.0.0/on_confirm.json b/plugins/schemas/ondc_trv10/v2.0.0/on_confirm.json new file mode 100644 index 0000000..4b35523 --- /dev/null +++ b/plugins/schemas/ondc_trv10/v2.0.0/on_confirm.json @@ -0,0 +1,16 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://ondc.org/trv10/2.0.0/on_confirm", + "type": "object", + "allOf": [ + { + "$ref": "../core/v1.1.0/confirm.json#" + }, + { + "$ref": "https://beckn.org/schema/confirm#" + }, + { + "$ref": "./init.json#/allOf/2" + } + ] +} \ No newline at end of file diff --git a/plugins/schema/ondc_trv10/on_init.json b/plugins/schemas/ondc_trv10/v2.0.0/on_init.json similarity index 99% rename from plugins/schema/ondc_trv10/on_init.json rename to plugins/schemas/ondc_trv10/v2.0.0/on_init.json index cc4b4f6..1f9a926 100644 --- a/plugins/schema/ondc_trv10/on_init.json +++ b/plugins/schemas/ondc_trv10/v2.0.0/on_init.json @@ -4,7 +4,7 @@ "type": "object", "allOf": [ { - "$ref": "../beckn_base/api/io/on_init.json#" + "$ref": "../core/v1.1.0/on_init.json#" }, { "$ref": "https://beckn.org/schema/on_init#" diff --git a/plugins/schemas/ondc_trv10/v2.0.0/on_rating.json b/plugins/schemas/ondc_trv10/v2.0.0/on_rating.json new file mode 100644 index 0000000..cc16530 --- /dev/null +++ b/plugins/schemas/ondc_trv10/v2.0.0/on_rating.json @@ -0,0 +1,16 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://ondc.org/trv10/2.0.0/on_rating", + "type": "object", + "allOf": [ + { + "$ref": "../core/v1.1.0/confirm.json#" + }, + { + "$ref": "https://beckn.org/schema/confirm#" + }, + { + "$ref": "./init.json#/allOf/2" + } + ] +} \ No newline at end of file diff --git a/plugins/schema/ondc_trv10/on_search.json b/plugins/schemas/ondc_trv10/v2.0.0/on_search.json similarity index 99% rename from plugins/schema/ondc_trv10/on_search.json rename to plugins/schemas/ondc_trv10/v2.0.0/on_search.json index 791f802..8a75d14 100644 --- a/plugins/schema/ondc_trv10/on_search.json +++ b/plugins/schemas/ondc_trv10/v2.0.0/on_search.json @@ -4,7 +4,7 @@ "type": "object", "allOf": [ { - "$ref": "../beckn_base/api/io/on_search.json#" + "$ref": "../core/v1.1.0/on_search.json#" }, { "$ref": "https://beckn.org/schema/on_search#" diff --git a/plugins/schema/ondc_trv10/on_select.json b/plugins/schemas/ondc_trv10/v2.0.0/on_select.json similarity index 99% rename from plugins/schema/ondc_trv10/on_select.json rename to plugins/schemas/ondc_trv10/v2.0.0/on_select.json index f16d1a2..df4ff0f 100644 --- a/plugins/schema/ondc_trv10/on_select.json +++ b/plugins/schemas/ondc_trv10/v2.0.0/on_select.json @@ -4,7 +4,7 @@ "type": "object", "allOf": [ { - "$ref": "../beckn_base/api/io/on_select.json#" + "$ref": "../core/v1.1.0/on_select.json#" }, { "$ref": "https://beckn.org/schema/on_select#" diff --git a/plugins/schemas/ondc_trv10/v2.0.0/on_status.json b/plugins/schemas/ondc_trv10/v2.0.0/on_status.json new file mode 100644 index 0000000..bb317b3 --- /dev/null +++ b/plugins/schemas/ondc_trv10/v2.0.0/on_status.json @@ -0,0 +1,16 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://ondc.org/trv10/2.0.0/on_status", + "type": "object", + "allOf": [ + { + "$ref": "../core/v1.1.0/confirm.json#" + }, + { + "$ref": "https://beckn.org/schema/confirm#" + }, + { + "$ref": "./init.json#/allOf/2" + } + ] +} \ No newline at end of file diff --git a/plugins/schemas/ondc_trv10/v2.0.0/on_support.json b/plugins/schemas/ondc_trv10/v2.0.0/on_support.json new file mode 100644 index 0000000..5d14baa --- /dev/null +++ b/plugins/schemas/ondc_trv10/v2.0.0/on_support.json @@ -0,0 +1,16 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://ondc.org/trv10/2.0.0/on_support", + "type": "object", + "allOf": [ + { + "$ref": "../core/v1.1.0/confirm.json#" + }, + { + "$ref": "https://beckn.org/schema/confirm#" + }, + { + "$ref": "./init.json#/allOf/2" + } + ] +} \ No newline at end of file diff --git a/plugins/schemas/ondc_trv10/v2.0.0/on_track.json b/plugins/schemas/ondc_trv10/v2.0.0/on_track.json new file mode 100644 index 0000000..5006787 --- /dev/null +++ b/plugins/schemas/ondc_trv10/v2.0.0/on_track.json @@ -0,0 +1,16 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://ondc.org/trv10/2.0.0/on_track", + "type": "object", + "allOf": [ + { + "$ref": "../core/v1.1.0/confirm.json#" + }, + { + "$ref": "https://beckn.org/schema/confirm#" + }, + { + "$ref": "./init.json#/allOf/2" + } + ] +} \ No newline at end of file diff --git a/plugins/schemas/ondc_trv10/v2.0.0/on_update.json b/plugins/schemas/ondc_trv10/v2.0.0/on_update.json new file mode 100644 index 0000000..3cc141f --- /dev/null +++ b/plugins/schemas/ondc_trv10/v2.0.0/on_update.json @@ -0,0 +1,16 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://ondc.org/trv10/2.0.0/on_update", + "type": "object", + "allOf": [ + { + "$ref": "../core/v1.1.0/confirm.json#" + }, + { + "$ref": "https://beckn.org/schema/confirm#" + }, + { + "$ref": "./init.json#/allOf/2" + } + ] +} \ No newline at end of file diff --git a/plugins/schema/ondc_trv10/rating.json b/plugins/schemas/ondc_trv10/v2.0.0/rating.json similarity index 84% rename from plugins/schema/ondc_trv10/rating.json rename to plugins/schemas/ondc_trv10/v2.0.0/rating.json index 3ec086c..6b6e9c7 100644 --- a/plugins/schema/ondc_trv10/rating.json +++ b/plugins/schemas/ondc_trv10/v2.0.0/rating.json @@ -4,7 +4,7 @@ "type": "object", "allOf": [ { - "$ref": "../beckn_base/api/io/rating.json#" + "$ref": "../core/v1.1.0/rating.json#" }, { "$ref": "https://beckn.org/schema/rating#" diff --git a/plugins/schema/ondc_trv10/search.json b/plugins/schemas/ondc_trv10/v2.0.0/search.json similarity index 98% rename from plugins/schema/ondc_trv10/search.json rename to plugins/schemas/ondc_trv10/v2.0.0/search.json index 3649f4e..6ecd87c 100644 --- a/plugins/schema/ondc_trv10/search.json +++ b/plugins/schemas/ondc_trv10/v2.0.0/search.json @@ -2,7 +2,7 @@ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://ondc.org/trv10/2.0.0/search", "allOf": [ - { "$ref": "../beckn_base/api/io/search.json#" }, + { "$ref": "../core/v1.1.0/search.json#" }, { "$ref": "https://beckn.org/schema/search#" } ], "type": "object", diff --git a/plugins/schema/ondc_trv10/select.json b/plugins/schemas/ondc_trv10/v2.0.0/select.json similarity index 85% rename from plugins/schema/ondc_trv10/select.json rename to plugins/schemas/ondc_trv10/v2.0.0/select.json index 977ed8a..324cedc 100644 --- a/plugins/schema/ondc_trv10/select.json +++ b/plugins/schemas/ondc_trv10/v2.0.0/select.json @@ -3,7 +3,7 @@ "$id": "https://ondc.org/trv10/2.0.0/select", "type": "object", "allOf": [ - { "$ref": "../beckn_base/api/io/select.json#" }, + { "$ref": "../core/v1.1.0/select.json#" }, { "$ref": "https://beckn.org/schema/select#" }, { "$ref": "./init.json#/$defs/init_schema_1" }, { "$ref": "../paths/init.json#/$defs/init_schema_2" } diff --git a/plugins/schema/ondc_trv10/status.json b/plugins/schemas/ondc_trv10/v2.0.0/status.json similarity index 91% rename from plugins/schema/ondc_trv10/status.json rename to plugins/schemas/ondc_trv10/v2.0.0/status.json index bae8c37..5d6ed73 100644 --- a/plugins/schema/ondc_trv10/status.json +++ b/plugins/schemas/ondc_trv10/v2.0.0/status.json @@ -4,7 +4,7 @@ "type": "object", "allOf": [ { - "$ref": "../beckn_base/api/io/status.json#" + "$ref": "../core/v1.1.0/status.json#" }, { "$ref": "https://beckn.org/schema/status#" diff --git a/plugins/schema/ondc_trv10/support.json b/plugins/schemas/ondc_trv10/v2.0.0/support.json similarity index 84% rename from plugins/schema/ondc_trv10/support.json rename to plugins/schemas/ondc_trv10/v2.0.0/support.json index 8524f21..e96c10c 100644 --- a/plugins/schema/ondc_trv10/support.json +++ b/plugins/schemas/ondc_trv10/v2.0.0/support.json @@ -4,7 +4,7 @@ "type": "object", "allOf": [ { - "$ref": "../beckn_base/api/io/support.json#" + "$ref": "../core/v1.1.0/support.json#" }, { "$ref": "https://beckn.org/schema/support#" diff --git a/plugins/schema/ondc_trv10/track.json b/plugins/schemas/ondc_trv10/v2.0.0/track.json similarity index 84% rename from plugins/schema/ondc_trv10/track.json rename to plugins/schemas/ondc_trv10/v2.0.0/track.json index cba069e..9de517e 100644 --- a/plugins/schema/ondc_trv10/track.json +++ b/plugins/schemas/ondc_trv10/v2.0.0/track.json @@ -4,7 +4,7 @@ "type": "object", "allOf": [ { - "$ref": "../beckn_base/api/io/track.json#" + "$ref": "../core/v1.1.0/track.json#" }, { "$ref": "https://beckn.org/schema/track#" diff --git a/plugins/schema/ondc_trv10/update.json b/plugins/schemas/ondc_trv10/v2.0.0/update.json similarity index 93% rename from plugins/schema/ondc_trv10/update.json rename to plugins/schemas/ondc_trv10/v2.0.0/update.json index 98c71f3..1f93324 100644 --- a/plugins/schema/ondc_trv10/update.json +++ b/plugins/schemas/ondc_trv10/v2.0.0/update.json @@ -4,7 +4,7 @@ "type": "object", "allOf": [ { - "$ref": "../beckn_base/api/io/update.json#" + "$ref": "../core/v1.1.0/update.json#" }, { "$ref": "https://beckn.org/schema/update#" diff --git a/plugins/schemas/ondc_trv10_2.0.0.json b/plugins/schemas_valid/ondc_trv10_2.0.0.json similarity index 100% rename from plugins/schemas/ondc_trv10_2.0.0.json rename to plugins/schemas_valid/ondc_trv10_2.0.0.json