Skip to content
This repository has been archived by the owner on May 26, 2021. It is now read-only.

Commit

Permalink
SMRT-1063 Adding optional fields (#9)
Browse files Browse the repository at this point in the history
SMRT-1063 Adding optional fields

co-authored-by: Jake Prem <jakeprem@gmail.com>
  • Loading branch information
JarredOlson and jakeprem committed Mar 26, 2019
1 parent a2b21ac commit 9447272
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 8 deletions.
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,18 @@ const Dataset = {
"contactEmail": "",
"license": "",
"rights": "",
"homepage": ""
"homepage": "",
"spatial": "",
"temporal": "",
"publishFrequency": "",
"conformsToUri": "",
"describedByUrl": "",
"describedByMimeType": "",
"parentDataset": "",
"issuedDate": "",
"language": "",
"referenceUrls": [""],
"categories": [""]
},
"technical": {
"dataName": "", // ~r/[a-zA-Z_]+$/
Expand Down
17 changes: 14 additions & 3 deletions lib/smart_city/dataset/business.ex
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,20 @@ defmodule SmartCity.Dataset.Business do
contactName: nil,
contactEmail: nil,
license: nil,
keywords: [],
rights: "",
homepage: ""
keywords: nil,
rights: nil,
homepage: nil,
spatial: nil,
temporal: nil,
publishFrequency: nil,
conformsToUri: nil,
describedByUrl: nil,
describedByMimeType: nil,
parentDataset: nil,
issuedDate: nil,
language: nil,
referenceUrls: nil,
categories: nil

@doc """
Returns a new `SmartCity.Dataset.Business` struct.
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ defmodule SmartCity.Registry.MixProject do
def project do
[
app: :smart_city_registry,
version: "2.3.1",
version: "2.4.0",
elixir: "~> 1.8",
start_permanent: Mix.env() == :prod,
deps: deps(),
Expand Down
2 changes: 1 addition & 1 deletion mix.lock
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
"patiently": {:hex, :patiently, "0.2.0", "67eb139591e10c4b363ae0198e832552f191c58894731efd3bf124ec4722267a", [:mix], [], "hexpm"},
"placebo": {:hex, :placebo, "1.2.1", "303ebb597279fd77b1f6d38ec377be4932f73246351f181d6128d0a58d3f74e9", [:mix], [{:meck, "~> 0.8.9", [hex: :meck, repo: "hexpm", optional: false]}], "hexpm"},
"redix": {:hex, :redix, "0.9.3", "c51d66657018a9b14f3b4496b1ba70ef6a16e8414cd19b34635242ac371beb95", [:mix], [], "hexpm"},
"smart_city": {:hex, :smart_city, "2.0.1", "35b70c122914bc966b25d665fafe2d60822016493e61d58680dbfe33698662b1", [:mix], [], "hexpm:smartcolumbus_os"},
"smart_city": {:hex, :smart_city, "2.1.0", "0f45d84afffd5dc0b709e8d6eccbcec0e4f5a4bd2a6920c0a7488a5cc2f2e26a", [:mix], [], "hexpm:smartcolumbus_os"},
}
4 changes: 2 additions & 2 deletions test/unit/smart_city/dataset/business_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ defmodule SmartCity.Dataset.BusinessTest do

test "returns default values for non-required fields", %{message: biz} do
actual = Business.new(biz)
assert actual.keywords == []
assert actual.rights == ""
assert actual.keywords == nil
assert actual.rights == nil
end

test "converts map with string keys to Business struct" do
Expand Down

0 comments on commit 9447272

Please sign in to comment.