Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
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.8"
env:
TEST_ALL: 1
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
# - 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) ]]
- run: bundle exec rspec
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/.bundle
/.rvmrc
/.idea
/coverage
/pkg
/rdoc
Expand Down
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.6.7
18 changes: 0 additions & 18 deletions .travis.yml

This file was deleted.

11 changes: 6 additions & 5 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -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
20 changes: 13 additions & 7 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
PATH
remote: .
specs:
openc-schema (1.1.0)
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
Expand Down Expand Up @@ -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
23 changes: 22 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
# 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

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

Expand Down
3 changes: 3 additions & 0 deletions build/accounts-statement-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,7 @@
}
}
},
"additionalProperties": false,
"required": [
"name"
]
Expand Down Expand Up @@ -795,6 +796,7 @@
"minLength": 1
}
},
"additionalProperties": false,
"required": [
"number"
]
Expand Down Expand Up @@ -957,6 +959,7 @@
]
}
},
"additionalProperties": false,
"required": [
"company_name",
"type"
Expand Down
3 changes: 3 additions & 0 deletions build/alternate-registration-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,7 @@
}
}
},
"additionalProperties": false,
"required": [
"name"
]
Expand Down Expand Up @@ -705,6 +706,7 @@
"minLength": 1
}
},
"additionalProperties": false,
"required": [
"number"
]
Expand Down Expand Up @@ -867,6 +869,7 @@
]
}
},
"additionalProperties": false,
"required": [
"company_name",
"type"
Expand Down
85 changes: 85 additions & 0 deletions build/alternative-name-schema.json
Original file line number Diff line number Diff line change
@@ -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": {
}
}
3 changes: 3 additions & 0 deletions build/company-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,7 @@
}
}
},
"additionalProperties": false,
"required": [
"name"
]
Expand Down Expand Up @@ -537,6 +538,7 @@
"minLength": 1
}
},
"additionalProperties": false,
"required": [
"number"
]
Expand Down Expand Up @@ -699,6 +701,7 @@
]
}
},
"additionalProperties": false,
"required": [
"company_name",
"type"
Expand Down
3 changes: 3 additions & 0 deletions build/control-statement-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -853,6 +853,7 @@
}
}
},
"additionalProperties": false,
"required": [
"name"
]
Expand Down Expand Up @@ -991,6 +992,7 @@
"minLength": 1
}
},
"additionalProperties": false,
"required": [
"number"
]
Expand Down Expand Up @@ -1153,6 +1155,7 @@
]
}
},
"additionalProperties": false,
"required": [
"company_name",
"type"
Expand Down
3 changes: 3 additions & 0 deletions build/filing-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,7 @@
}
}
},
"additionalProperties": false,
"required": [
"name"
]
Expand Down Expand Up @@ -718,6 +719,7 @@
"minLength": 1
}
},
"additionalProperties": false,
"required": [
"number"
]
Expand Down Expand Up @@ -880,6 +882,7 @@
]
}
},
"additionalProperties": false,
"required": [
"company_name",
"type"
Expand Down
3 changes: 3 additions & 0 deletions build/gazette-notice-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1211,6 +1211,7 @@
}
}
},
"additionalProperties": false,
"required": [
"name"
]
Expand Down Expand Up @@ -1349,6 +1350,7 @@
"minLength": 1
}
},
"additionalProperties": false,
"required": [
"number"
]
Expand Down Expand Up @@ -1511,6 +1513,7 @@
]
}
},
"additionalProperties": false,
"required": [
"company_name",
"type"
Expand Down
Loading