From 6602e3321a0204507c1a682678e55183c18ee33c Mon Sep 17 00:00:00 2001 From: Asfand Qazi Date: Tue, 6 Jul 2021 11:57:47 +0100 Subject: [PATCH 01/14] Lock Ruby version to 2.6.7 --- .ruby-version | 1 + 1 file changed, 1 insertion(+) create mode 100644 .ruby-version diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 0000000..e261122 --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +2.6.7 From 00160660eb85cd63120fe558a5117534c2ee185e Mon Sep 17 00:00:00 2001 From: Asfand Qazi Date: Tue, 6 Jul 2021 12:00:09 +0100 Subject: [PATCH 02/14] Rearrange project into a gem Create gemspec with a "dev" version Move runtime deps from Gemfile to gemspec Lock dep versions so Gemfile.lock does not change --- Gemfile | 11 ++++++----- Gemfile.lock | 20 +++++++++++++------- openc-schema.gemspec | 23 +++++++++++++++++++++++ 3 files changed, 42 insertions(+), 12 deletions(-) create mode 100644 openc-schema.gemspec diff --git a/Gemfile b/Gemfile index 8b2de3b..91b54d1 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,8 @@ source "https://rubygems.org" -gem "openc-json_schema" -gem "rake" -gem "rspec" -gem "json_validation" -gem "openc_json_schema_formats" +group :development, :test do + gem "rake", "~> 10.3" + gem "rspec", "~> 3" +end + +gemspec diff --git a/Gemfile.lock b/Gemfile.lock index 8b91b0e..8d438f6 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,10 +1,18 @@ +PATH + remote: . + specs: + openc-schema (1.0.0.dev) + json_validation (= 0.1.0) + openc-json_schema (= 0.0.14) + openc_json_schema_formats (= 0.1.3) + GEM remote: https://rubygems.org/ specs: addressable (2.3.8) diff-lcs (1.3) json-pointer (0.0.1) - json-schema (2.6.0) + json-schema (2.6.2) addressable (~> 2.3.8) json_validation (0.1.0) addressable @@ -32,11 +40,9 @@ PLATFORMS ruby DEPENDENCIES - json_validation - openc-json_schema - openc_json_schema_formats - rake - rspec + openc-schema! + rake (~> 10.3) + rspec (~> 3) BUNDLED WITH - 1.16.2 + 1.17.2 diff --git a/openc-schema.gemspec b/openc-schema.gemspec new file mode 100644 index 0000000..d4dd7e6 --- /dev/null +++ b/openc-schema.gemspec @@ -0,0 +1,23 @@ +lib = File.expand_path("../lib", __FILE__) +$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) + +Gem::Specification.new do |spec| + spec.name = "openc-schema" + spec.version = "1.0.0.dev" + spec.authors = ["OpenCorporates dev team"] + + spec.summary = %q{JSON Schema to validate data before sending to OpenCorporates.} + spec.homepage = "https://github.com/openc/openc-schema" + + # Specify which files should be added to the gem when it is released. + # The `git ls-files -z` loads the files in the RubyGem that have been added into git. + spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do + `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)|\.ruby-version/}) } + end + spec.bindir = "exe" + spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } + + spec.add_runtime_dependency "openc-json_schema", "= 0.0.14" + spec.add_runtime_dependency "json_validation", "= 0.1.0" + spec.add_runtime_dependency "openc_json_schema_formats", "= 0.1.3" +end From 6efd94a4cb0c0b12e0a7971b1d36ea2eb333ddf6 Mon Sep 17 00:00:00 2001 From: Asfand Qazi Date: Tue, 6 Jul 2021 12:39:55 +0100 Subject: [PATCH 03/14] Add GitHub Action that runs the same tests as Travis CI used to --- .github/workflows/test.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..4782c7b --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,35 @@ +--- +name: Test + +on: [pull_request] + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + ruby: + - "2.0" + - "2.1" + - "2.2" + - "2.3" + - "2.4" + - "2.5" + - "2.6.3" + - "2.6.7" + - "2.7" + env: + TEST_ALL: 1 + steps: + - uses: actions/checkout@v2 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + - run: gem update --system 2.7.8 + if: ${{ matrix.ruby == '2.0' || matrix.ruby == '2.1' || matrix.ruby == '2.2' }} + - run: gem update --system + if: ${{ matrix.ruby != '2.0' && matrix.ruby != '2.1' && matrix.ruby != '2.2' }} + - run: gem install bundler -v 1.17.3 + - run: bundle install + - run: bin/rake build format_json && git status -s && [[ -z $(git status -s) ]] + - run: bundle exec rspec From 15be2308d942d7c7126f9a9adfd67b8ba4091eb4 Mon Sep 17 00:00:00 2001 From: Asfand Qazi Date: Tue, 6 Jul 2021 13:02:20 +0100 Subject: [PATCH 04/14] Remove .travis.yml --- .travis.yml | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 398343b..0000000 --- a/.travis.yml +++ /dev/null @@ -1,18 +0,0 @@ -sudo: false -language: ruby -cache: bundler -env: - - TEST_ALL=true -rvm: - - 1.9.3 - - 2.0.0 - - 2.1 - - 2.2 - - 2.3 - - 2.4 - - 2.5 - - 2.6 -before_install: - - gem update --system 2.7.8 - - gem install bundler -v 1.17.3 -before_script: bin/rake build format_json && git status -s && [[ -z $(git status -s) ]] From 58b33cd0b141ef297e5526947a65599da45f0a79 Mon Sep 17 00:00:00 2001 From: Asfand Qazi Date: Tue, 6 Jul 2021 16:21:56 +0100 Subject: [PATCH 05/14] Add usage notes to README.md Describe how it must be included in the Gemfile, and how to get to the schema files. --- README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.md b/README.md index f68bb7d..37b709c 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,23 @@ JSON Schema to validate data before sending to OpenCorporates. +## Usage + +Include it in your Gemfile: + +``` +gem "openc-schema", git: "https://github.com/openc/openc-schema", tag: "vx.y.z" +``` + +Then get the path to the schema files: + +``` +File.join(Gem.loaded_specs['openc-schema'].full_gem_path, "schemas/company-schema.json") +``` + +If you are using a library that uses this gem, you must include this gem along with the library in your Gemfile. +This will be required until this gem is hosted in a proper gem registry. + ## Tasks Rewrite JSON files with consistent formatting: From c10e02f8b2d895415baf75f2b5935cb22a4dac68 Mon Sep 17 00:00:00 2001 From: CountCulture Date: Wed, 31 Mar 2021 11:47:10 +0100 Subject: [PATCH 06/14] Restrict additionalProperties for officers and alternative_names --- schemas/includes/alternative-name.json | 1 + schemas/includes/officer.json | 1 + .../additional-alternative_names.0.con_date.json | 13 +++++++++++++ .../invalid/company/additional-officers.0.dob.json | 12 ++++++++++++ .../invalid/company/additional-officers.0.type.json | 12 ++++++++++++ 5 files changed, 39 insertions(+) create mode 100644 spec/sample-data/invalid/company/additional-alternative_names.0.con_date.json create mode 100644 spec/sample-data/invalid/company/additional-officers.0.dob.json create mode 100644 spec/sample-data/invalid/company/additional-officers.0.type.json diff --git a/schemas/includes/alternative-name.json b/schemas/includes/alternative-name.json index 12a6c7a..549a035 100644 --- a/schemas/includes/alternative-name.json +++ b/schemas/includes/alternative-name.json @@ -31,6 +31,7 @@ ] } }, + "additionalProperties": false, "required": [ "company_name", "type" diff --git a/schemas/includes/officer.json b/schemas/includes/officer.json index e973e95..d5608f0 100644 --- a/schemas/includes/officer.json +++ b/schemas/includes/officer.json @@ -67,6 +67,7 @@ } } }, + "additionalProperties": false, "required": [ "name" ] diff --git a/spec/sample-data/invalid/company/additional-alternative_names.0.con_date.json b/spec/sample-data/invalid/company/additional-alternative_names.0.con_date.json new file mode 100644 index 0000000..68516ad --- /dev/null +++ b/spec/sample-data/invalid/company/additional-alternative_names.0.con_date.json @@ -0,0 +1,13 @@ +{ + "name": "Foo Inc Alternative", + "jurisdiction_code": "us_de", + "company_number": "12345", + "alternative_names": [ + { + "company_name": "Foobar Inc", + "type": "trading", + "con_date": "2020-03-04" + } + ], + "retrieved_at": "2018-03-09T12:34:56Z" +} diff --git a/spec/sample-data/invalid/company/additional-officers.0.dob.json b/spec/sample-data/invalid/company/additional-officers.0.dob.json new file mode 100644 index 0000000..4a26098 --- /dev/null +++ b/spec/sample-data/invalid/company/additional-officers.0.dob.json @@ -0,0 +1,12 @@ +{ + "name": "Foo Inc", + "company_number": "12345", + "jurisdiction_code": "ie", + "officers": [ + { + "name": "Fred", + "dob": "1980-02-16" + } + ], + "retrieved_at": "2018-03-09T12:34:56Z" +} diff --git a/spec/sample-data/invalid/company/additional-officers.0.type.json b/spec/sample-data/invalid/company/additional-officers.0.type.json new file mode 100644 index 0000000..cbb1265 --- /dev/null +++ b/spec/sample-data/invalid/company/additional-officers.0.type.json @@ -0,0 +1,12 @@ +{ + "name": "Foo Inc", + "company_number": "12345", + "jurisdiction_code": "ie", + "officers": [ + { + "name": "Fred", + "type": "Company" + } + ], + "retrieved_at": "2018-03-09T12:34:56Z" +} From f8651b8045cf208d45bcaa1a6598fe9f4587cc11 Mon Sep 17 00:00:00 2001 From: CountCulture Date: Wed, 31 Mar 2021 11:51:23 +0100 Subject: [PATCH 07/14] Update consolidated schemas with new restrictions --- build/accounts-statement-schema.json | 2 ++ build/alternate-registration-schema.json | 2 ++ build/company-schema.json | 2 ++ build/control-statement-schema.json | 2 ++ build/filing-schema.json | 2 ++ build/gazette-notice-schema.json | 2 ++ build/licence-schema.json | 2 ++ build/register-entry-schema.json | 2 ++ build/sanctioned-entity-schema.json | 2 ++ build/subsequent-registration-schema.json | 2 ++ build/supplier-relationship-schema.json | 2 ++ build/trademark-registration-schema.json | 2 ++ 12 files changed, 24 insertions(+) diff --git a/build/accounts-statement-schema.json b/build/accounts-statement-schema.json index 0953826..076042a 100644 --- a/build/accounts-statement-schema.json +++ b/build/accounts-statement-schema.json @@ -657,6 +657,7 @@ } } }, + "additionalProperties": false, "required": [ "name" ] @@ -957,6 +958,7 @@ ] } }, + "additionalProperties": false, "required": [ "company_name", "type" diff --git a/build/alternate-registration-schema.json b/build/alternate-registration-schema.json index 0955ef0..b5bfd7d 100644 --- a/build/alternate-registration-schema.json +++ b/build/alternate-registration-schema.json @@ -567,6 +567,7 @@ } } }, + "additionalProperties": false, "required": [ "name" ] @@ -867,6 +868,7 @@ ] } }, + "additionalProperties": false, "required": [ "company_name", "type" diff --git a/build/company-schema.json b/build/company-schema.json index 2bd74c6..610150b 100644 --- a/build/company-schema.json +++ b/build/company-schema.json @@ -399,6 +399,7 @@ } } }, + "additionalProperties": false, "required": [ "name" ] @@ -699,6 +700,7 @@ ] } }, + "additionalProperties": false, "required": [ "company_name", "type" diff --git a/build/control-statement-schema.json b/build/control-statement-schema.json index bbd73a1..541920b 100644 --- a/build/control-statement-schema.json +++ b/build/control-statement-schema.json @@ -853,6 +853,7 @@ } } }, + "additionalProperties": false, "required": [ "name" ] @@ -1153,6 +1154,7 @@ ] } }, + "additionalProperties": false, "required": [ "company_name", "type" diff --git a/build/filing-schema.json b/build/filing-schema.json index 2a9c01d..72e0d04 100644 --- a/build/filing-schema.json +++ b/build/filing-schema.json @@ -580,6 +580,7 @@ } } }, + "additionalProperties": false, "required": [ "name" ] @@ -880,6 +881,7 @@ ] } }, + "additionalProperties": false, "required": [ "company_name", "type" diff --git a/build/gazette-notice-schema.json b/build/gazette-notice-schema.json index c061fa6..ae8871a 100644 --- a/build/gazette-notice-schema.json +++ b/build/gazette-notice-schema.json @@ -1211,6 +1211,7 @@ } } }, + "additionalProperties": false, "required": [ "name" ] @@ -1511,6 +1512,7 @@ ] } }, + "additionalProperties": false, "required": [ "company_name", "type" diff --git a/build/licence-schema.json b/build/licence-schema.json index dda781a..b2ff2a9 100644 --- a/build/licence-schema.json +++ b/build/licence-schema.json @@ -589,6 +589,7 @@ } } }, + "additionalProperties": false, "required": [ "name" ] @@ -889,6 +890,7 @@ ] } }, + "additionalProperties": false, "required": [ "company_name", "type" diff --git a/build/register-entry-schema.json b/build/register-entry-schema.json index ac4debf..720d603 100644 --- a/build/register-entry-schema.json +++ b/build/register-entry-schema.json @@ -366,6 +366,7 @@ ] } }, + "additionalProperties": false, "required": [ "company_name", "type" @@ -800,6 +801,7 @@ } } }, + "additionalProperties": false, "required": [ "name" ] diff --git a/build/sanctioned-entity-schema.json b/build/sanctioned-entity-schema.json index 05524d7..e1a9e68 100644 --- a/build/sanctioned-entity-schema.json +++ b/build/sanctioned-entity-schema.json @@ -364,6 +364,7 @@ ] } }, + "additionalProperties": false, "required": [ "company_name", "type" @@ -798,6 +799,7 @@ } } }, + "additionalProperties": false, "required": [ "name" ] diff --git a/build/subsequent-registration-schema.json b/build/subsequent-registration-schema.json index bfefb93..19e0f4b 100644 --- a/build/subsequent-registration-schema.json +++ b/build/subsequent-registration-schema.json @@ -568,6 +568,7 @@ } } }, + "additionalProperties": false, "required": [ "name" ] @@ -868,6 +869,7 @@ ] } }, + "additionalProperties": false, "required": [ "company_name", "type" diff --git a/build/supplier-relationship-schema.json b/build/supplier-relationship-schema.json index 17fdb00..62610df 100644 --- a/build/supplier-relationship-schema.json +++ b/build/supplier-relationship-schema.json @@ -561,6 +561,7 @@ } } }, + "additionalProperties": false, "required": [ "name" ] @@ -861,6 +862,7 @@ ] } }, + "additionalProperties": false, "required": [ "company_name", "type" diff --git a/build/trademark-registration-schema.json b/build/trademark-registration-schema.json index 09d50b9..398e690 100644 --- a/build/trademark-registration-schema.json +++ b/build/trademark-registration-schema.json @@ -676,6 +676,7 @@ } } }, + "additionalProperties": false, "required": [ "name" ] @@ -976,6 +977,7 @@ ] } }, + "additionalProperties": false, "required": [ "company_name", "type" From bd14707759b6265f1d6a68a2d729298c78e4b348 Mon Sep 17 00:00:00 2001 From: Daniel Key Date: Wed, 8 Jan 2020 11:57:49 +0000 Subject: [PATCH 08/14] Stops extra properties on total-shares To match app/models/data_delegates/total_shares.rb in openc which will error if handed extra properties --- build/accounts-statement-schema.json | 1 + build/alternate-registration-schema.json | 1 + build/company-schema.json | 1 + build/control-statement-schema.json | 1 + build/filing-schema.json | 1 + build/gazette-notice-schema.json | 1 + build/licence-schema.json | 1 + build/register-entry-schema.json | 1 + build/sanctioned-entity-schema.json | 1 + build/subsequent-registration-schema.json | 1 + build/supplier-relationship-schema.json | 1 + build/trademark-registration-schema.json | 1 + schemas/includes/total-shares.json | 1 + .../invalid/includes/total-shares/additional-foo.json | 5 +++++ spec/sample-data/valid/includes/total-shares-01.json | 4 ++++ 15 files changed, 22 insertions(+) create mode 100644 spec/sample-data/invalid/includes/total-shares/additional-foo.json create mode 100644 spec/sample-data/valid/includes/total-shares-01.json diff --git a/build/accounts-statement-schema.json b/build/accounts-statement-schema.json index 076042a..f365381 100644 --- a/build/accounts-statement-schema.json +++ b/build/accounts-statement-schema.json @@ -796,6 +796,7 @@ "minLength": 1 } }, + "additionalProperties": false, "required": [ "number" ] diff --git a/build/alternate-registration-schema.json b/build/alternate-registration-schema.json index b5bfd7d..147a1ed 100644 --- a/build/alternate-registration-schema.json +++ b/build/alternate-registration-schema.json @@ -706,6 +706,7 @@ "minLength": 1 } }, + "additionalProperties": false, "required": [ "number" ] diff --git a/build/company-schema.json b/build/company-schema.json index 610150b..5ccbc9a 100644 --- a/build/company-schema.json +++ b/build/company-schema.json @@ -538,6 +538,7 @@ "minLength": 1 } }, + "additionalProperties": false, "required": [ "number" ] diff --git a/build/control-statement-schema.json b/build/control-statement-schema.json index 541920b..74ccf28 100644 --- a/build/control-statement-schema.json +++ b/build/control-statement-schema.json @@ -992,6 +992,7 @@ "minLength": 1 } }, + "additionalProperties": false, "required": [ "number" ] diff --git a/build/filing-schema.json b/build/filing-schema.json index 72e0d04..19c0e95 100644 --- a/build/filing-schema.json +++ b/build/filing-schema.json @@ -719,6 +719,7 @@ "minLength": 1 } }, + "additionalProperties": false, "required": [ "number" ] diff --git a/build/gazette-notice-schema.json b/build/gazette-notice-schema.json index ae8871a..a9bdbd7 100644 --- a/build/gazette-notice-schema.json +++ b/build/gazette-notice-schema.json @@ -1350,6 +1350,7 @@ "minLength": 1 } }, + "additionalProperties": false, "required": [ "number" ] diff --git a/build/licence-schema.json b/build/licence-schema.json index b2ff2a9..66e526d 100644 --- a/build/licence-schema.json +++ b/build/licence-schema.json @@ -728,6 +728,7 @@ "minLength": 1 } }, + "additionalProperties": false, "required": [ "number" ] diff --git a/build/register-entry-schema.json b/build/register-entry-schema.json index 720d603..c828d89 100644 --- a/build/register-entry-schema.json +++ b/build/register-entry-schema.json @@ -940,6 +940,7 @@ "minLength": 1 } }, + "additionalProperties": false, "required": [ "number" ] diff --git a/build/sanctioned-entity-schema.json b/build/sanctioned-entity-schema.json index e1a9e68..61afa00 100644 --- a/build/sanctioned-entity-schema.json +++ b/build/sanctioned-entity-schema.json @@ -938,6 +938,7 @@ "minLength": 1 } }, + "additionalProperties": false, "required": [ "number" ] diff --git a/build/subsequent-registration-schema.json b/build/subsequent-registration-schema.json index 19e0f4b..31a435b 100644 --- a/build/subsequent-registration-schema.json +++ b/build/subsequent-registration-schema.json @@ -707,6 +707,7 @@ "minLength": 1 } }, + "additionalProperties": false, "required": [ "number" ] diff --git a/build/supplier-relationship-schema.json b/build/supplier-relationship-schema.json index 62610df..bff8b1b 100644 --- a/build/supplier-relationship-schema.json +++ b/build/supplier-relationship-schema.json @@ -700,6 +700,7 @@ "minLength": 1 } }, + "additionalProperties": false, "required": [ "number" ] diff --git a/build/trademark-registration-schema.json b/build/trademark-registration-schema.json index 398e690..5926eb9 100644 --- a/build/trademark-registration-schema.json +++ b/build/trademark-registration-schema.json @@ -815,6 +815,7 @@ "minLength": 1 } }, + "additionalProperties": false, "required": [ "number" ] diff --git a/schemas/includes/total-shares.json b/schemas/includes/total-shares.json index a945f4f..077161f 100644 --- a/schemas/includes/total-shares.json +++ b/schemas/includes/total-shares.json @@ -11,6 +11,7 @@ "minLength": 1 } }, + "additionalProperties": false, "required": [ "number" ] diff --git a/spec/sample-data/invalid/includes/total-shares/additional-foo.json b/spec/sample-data/invalid/includes/total-shares/additional-foo.json new file mode 100644 index 0000000..4f32df9 --- /dev/null +++ b/spec/sample-data/invalid/includes/total-shares/additional-foo.json @@ -0,0 +1,5 @@ +{ + "number": 100, + "share_class": "A", + "foo": "bar" +} diff --git a/spec/sample-data/valid/includes/total-shares-01.json b/spec/sample-data/valid/includes/total-shares-01.json new file mode 100644 index 0000000..8dd2a07 --- /dev/null +++ b/spec/sample-data/valid/includes/total-shares-01.json @@ -0,0 +1,4 @@ +{ + "number": 100, + "share_class": "A" +} From 9ed78b40ee4fb3efa3bd21cacd359a00bcd201f3 Mon Sep 17 00:00:00 2001 From: Harry Wood Date: Mon, 15 Feb 2021 14:28:05 +0000 Subject: [PATCH 09/14] README clarification. Not API schema --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 37b709c..02f994d 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,10 @@ # openc-schema -JSON Schema to validate data before sending to OpenCorporates. +JSON Schema to validate data before sending it to be **ingested into** OpenCorporates. + +Originally these files were designed for use by external developers, along with the [openc_bot gem](https://github.com/openc/openc_bot), with OpenCorporates encouraging anyone to join in with writing bots for data gathering and ingestion. Lately we have moved away from that approach, and all meaningful use of these schema files is confined to bots living in our own private repos. + +Looking for a schema description of the OpenCorporates API? We're working on something, so let us know you're interested (But this repo is not it!) ## Usage From fe5c2de46715001b7f1369b567ab56f145f8b755 Mon Sep 17 00:00:00 2001 From: Asfand Qazi Date: Wed, 7 Jul 2021 12:18:12 +0100 Subject: [PATCH 10/14] Bump version to 1.1.0.rc1 This is the first release candidate of v1.1.0. It will be released as v1.1.0 after it has been tested by the machine_bot project. --- Gemfile.lock | 2 +- openc-schema.gemspec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 8d438f6..e0e819a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - openc-schema (1.0.0.dev) + openc-schema (1.1.0.rc1) json_validation (= 0.1.0) openc-json_schema (= 0.0.14) openc_json_schema_formats (= 0.1.3) diff --git a/openc-schema.gemspec b/openc-schema.gemspec index d4dd7e6..2f701bb 100644 --- a/openc-schema.gemspec +++ b/openc-schema.gemspec @@ -3,7 +3,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) Gem::Specification.new do |spec| spec.name = "openc-schema" - spec.version = "1.0.0.dev" + spec.version = "1.1.0.rc1" spec.authors = ["OpenCorporates dev team"] spec.summary = %q{JSON Schema to validate data before sending to OpenCorporates.} From 1612ce1b1501871c2b0c1bb04fda5c71f21d7cc2 Mon Sep 17 00:00:00 2001 From: Asfand Qazi Date: Wed, 28 Jul 2021 12:09:35 +0100 Subject: [PATCH 11/14] Bump version to 1.1.0 Is identical to v1.1.0-rc1, which has been successfully used in several bots --- Gemfile.lock | 2 +- openc-schema.gemspec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index e0e819a..3b7a251 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - openc-schema (1.1.0.rc1) + openc-schema (1.1.0) json_validation (= 0.1.0) openc-json_schema (= 0.0.14) openc_json_schema_formats (= 0.1.3) diff --git a/openc-schema.gemspec b/openc-schema.gemspec index 2f701bb..0d259cc 100644 --- a/openc-schema.gemspec +++ b/openc-schema.gemspec @@ -3,7 +3,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) Gem::Specification.new do |spec| spec.name = "openc-schema" - spec.version = "1.1.0.rc1" + spec.version = "1.1.0" spec.authors = ["OpenCorporates dev team"] spec.summary = %q{JSON Schema to validate data before sending to OpenCorporates.} From dfe5d3fdaf9b5842bc16bc5df3dcca44da1b65f6 Mon Sep 17 00:00:00 2001 From: Ben Ellis Date: Mon, 12 May 2025 11:23:07 +0100 Subject: [PATCH 12/14] chore: Added missing alternative-name-schema.json to build. --- build/alternative-name-schema.json | 85 ++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 build/alternative-name-schema.json diff --git a/build/alternative-name-schema.json b/build/alternative-name-schema.json new file mode 100644 index 0000000..45e9dec --- /dev/null +++ b/build/alternative-name-schema.json @@ -0,0 +1,85 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "description": "Doing Business As, also known as fictitious name or trade name", + "type": "object", + "properties": { + "name": { + "description": "The name registered", + "type": "string" + }, + "type": { + "description": "Type of alternative name", + "type": "string", + "enum": [ + "Assumed Name", + "Trade Name", + "DBA / doing business as", + "Fictitious Name", + "Other" + ] + }, + "registered_address": { + "description": "The address filing was registered to", + "type": "object" + }, + "start_date": { + "type": "string", + "format": "date" + }, + "end_date": { + "type": "string", + "format": "date" + }, + "filing_number": { + "description": "The registers unique id for this record", + "type": "string" + }, + "source_jurisdiction": { + "type": "string", + "minLength": 1 + }, + "source_url": { + "description": "Place where this fact can be verified", + "type": "string", + "minLength": 1 + }, + "confidence": { + "description": "Confidence in accuracy of data", + "type": "string", + "enum": [ + "HIGH", + "MEDIUM", + "LOW" + ] + }, + "sample_date": { + "description": "Date on which we know this to be true (usually date this information was retrieved from the source)", + "type": "string", + "format": "date" + }, + "retrieved_at": { + "description": "The time or date at which the source URL was requested", + "type": "string", + "format": "date-time" + }, + "owner_entities": { + "description": "Lists of owner companies, and persons should this data be available", + "type": "object" + }, + "other_attributes": { + "description": "Dump of all other relevant data for which we don't yet have curated schema attributes", + "type": "object" + } + }, + "required": [ + "name", + "type", + "owner_entities", + "retrieved_at", + "sample_date", + "source_url", + "source_jurisdiction" + ], + "definitions": { + } +} \ No newline at end of file From 7be6347ded4c99909359c147de4a4a5abeb924cb Mon Sep 17 00:00:00 2001 From: Ben Ellis Date: Mon, 12 May 2025 10:54:58 +0100 Subject: [PATCH 13/14] chore: Fix for failling tests. --- .github/workflows/test.yml | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4782c7b..946088c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,15 +9,15 @@ jobs: strategy: matrix: ruby: - - "2.0" - - "2.1" - - "2.2" - - "2.3" - - "2.4" - - "2.5" - - "2.6.3" - - "2.6.7" - - "2.7" +# - "2.0" +# - "2.1" +# - "2.2" +# - "2.3" +# - "2.4" +# - "2.5" +# - "2.6.3" +# - "2.6.7" + - "2.7.8" env: TEST_ALL: 1 steps: @@ -25,10 +25,14 @@ jobs: - uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }} - - run: gem update --system 2.7.8 - if: ${{ matrix.ruby == '2.0' || matrix.ruby == '2.1' || matrix.ruby == '2.2' }} - - run: gem update --system - if: ${{ matrix.ruby != '2.0' && matrix.ruby != '2.1' && matrix.ruby != '2.2' }} +# - run: gem install rubygems-update -v '<= 2.7.8' +# if: ${{ matrix.ruby == '2.0' || matrix.ruby == '2.1' || matrix.ruby == '2.2' }} +# - run: gem update --system 2.7.8 +# if: ${{ matrix.ruby == '2.0' || matrix.ruby == '2.1' || matrix.ruby == '2.2' }} +# - run: gem install rubygems-update -v '<= ${{matrix.ruby}}' +# if: ${{ matrix.ruby != '2.0' && matrix.ruby != '2.1' && matrix.ruby != '2.2' }} +# - run: gem update --system +# if: ${{ matrix.ruby != '2.0' && matrix.ruby != '2.1' && matrix.ruby != '2.2' }} - run: gem install bundler -v 1.17.3 - run: bundle install - run: bin/rake build format_json && git status -s && [[ -z $(git status -s) ]] From 1288c1de2de6a4911c2f11ee6cadc38f3dd81469 Mon Sep 17 00:00:00 2001 From: CountCulture Date: Wed, 31 Mar 2021 11:47:10 +0100 Subject: [PATCH 14/14] Restrict additionalProperties for officers and alternative_names --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index fef3ac0..70080e4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ /.bundle /.rvmrc +/.idea /coverage /pkg /rdoc