kwalify_to_json_schema 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2c071ca240ae54308f08beacbb2ddf8ac8646662b435ffca2b20bb3959e09984
4
- data.tar.gz: 8c0b65039cf2ee1ff6f96e44b9053da918a47e33db8f9479f3e845e51d5997e5
3
+ metadata.gz: '06494f442be72dab717741fd0515c09e57541add4d42fd0740fd6ec475d18e08'
4
+ data.tar.gz: 0e3969aae90bda694a8beae488ecabfce80ee15ec381eca3f050456a1b7d4d45
5
5
  SHA512:
6
- metadata.gz: 00dc73a490152a8a715a577496eb25c0c61fc31313afc5475e4ec5471ffcac928a4029feda22583a8ff43f2a6a79d352a221bb67e1b5912b099ec467107602f6
7
- data.tar.gz: aca9041623512921a06a012c27d874733b4cda5fcc18e19d7c7035629f8b39ae2de563fd0358ae6e75bc23bf4dd4d0e3aef10a78add72de0521e5fe242f42ac1
6
+ metadata.gz: b5f7763ebef99718db807a839965f2118be48abe005616147a2a3c038adeb37a82564448faf52e35e6d782ce0666fad36902ed1e3832be8f7c67a7150471dc09
7
+ data.tar.gz: 5f690c9b95207db9329056ecaf74896beca736c634bf67659e16220613fa6cd5368dcc8160bd2b739262acc78026d09aed406853c025d0789509c2f4a6a95d4d
@@ -29,6 +29,7 @@ module KwalifyToJsonSchema
29
29
  option(*Options.cli_option(Options::TITLE))
30
30
  option(*Options.cli_option(Options::DESCRIPTION))
31
31
  option(*Options.cli_option(Options::ISSUES_TO_DESCRIPTION))
32
+ option(*Options.cli_option(Options::SCHEMA_VERSION))
32
33
  option Options::CUSTOM_PROCESSING,
33
34
  :type => :string,
34
35
  :desc => <<~DESC
@@ -58,6 +59,7 @@ module KwalifyToJsonSchema
58
59
  :default => false,
59
60
  :desc => "Process files recursively",
60
61
  :long_desc => ""
62
+ option(*Options.cli_option(Options::SCHEMA_VERSION))
61
63
  option Options::CUSTOM_PROCESSING,
62
64
  :type => :string,
63
65
  :desc => <<~DESC
@@ -26,7 +26,7 @@ module KwalifyToJsonSchema
26
26
  # | :description | string | nil | The JSON schema description. If not given the Kwalify description will be used if present|
27
27
  # | :issues_to_description| boolean| false | To append the issuses to the JSON schema description |
28
28
  # | :custom_processing | object | nil | To customize the conversion |
29
- # | :schema_version | String | "draft-04" | JSON schema version. Changing this value only change the value of $schema field |
29
+ # | :schema_version | string | "draft-04" | JSON schema version. Changing this value only change the value of $schema field |
30
30
  # --
31
31
  def initialize(options_hash = {})
32
32
  @options = Options.new(options_hash)
@@ -58,7 +58,7 @@ module KwalifyToJsonSchema
58
58
  def root
59
59
  {
60
60
  "$schema" => SCHEMA % options.schema_version,
61
- "$id" => options.id,
61
+ "id" => options.id,
62
62
  "title" => options.title,
63
63
  }.reject { |k, v| v.nil? }
64
64
  end
@@ -79,6 +79,7 @@ module KwalifyToJsonSchema
79
79
  if mapping.is_a? Hash
80
80
  properties = target["properties"] = {}
81
81
  mapping.each_pair { |name, e|
82
+ next if name == "=" # Ignore mapping default value
82
83
  process(properties[name] = {}, e)
83
84
  required << name if e["required"] == true
84
85
  }
@@ -12,7 +12,7 @@ module KwalifyToJsonSchema
12
12
  # | :description | string | nil | The JSON schema description. If not given the Kwalify description will be used if present|
13
13
  # | :issues_to_description| boolean| false | To append the issuses to the JSON schema description |
14
14
  # | :custom_processing | object | nil | To customize the conversion |
15
- # | :schema_version | String | "draft-04" | JSON schema version. Changing this value only change the value of $schema field |
15
+ # | :schema_version | string | "draft-04" | JSON schema version. Changing this value only change the value of $schema field |
16
16
  # --
17
17
  # @param source Path to Kwalify YAML schema
18
18
  # @param dest Path to resulting JSON schema
@@ -36,7 +36,7 @@ module KwalifyToJsonSchema
36
36
  # | :description | string | nil | The JSON schema description. If not given the Kwalify description will be used if present|
37
37
  # | :issues_to_description| boolean| false | To append the issuses to the JSON schema description |
38
38
  # | :custom_processing | object | nil | To customize the conversion |
39
- # | :schema_version | String | "draft-04" | JSON schema version. Changing this value only change the value of $schema field |
39
+ # | :schema_version | string | "draft-04" | JSON schema version. Changing this value only change the value of $schema field |
40
40
  # --
41
41
  # @param kwalify_schema Kwalify schema as YAML or JSON
42
42
  # @param source_format format of the source schema
@@ -9,7 +9,7 @@ module KwalifyToJsonSchema
9
9
  # | :description | string | nil | The JSON schema description. If not given the Kwalify description will be used if present|
10
10
  # | :issues_to_description| boolean| false | To append the issuses to the JSON schema description |
11
11
  # | :custom_processing | object | nil | To customize the conversion |
12
- # | :schema_version | String | "draft-04" | JSON schema version. Changing this value only change the value of $schema field |
12
+ # | :schema_version | string | "draft-04" | JSON schema version. Changing this value only change the value of $schema field |
13
13
  # --
14
14
  DECLARATION = %q(
15
15
  ID # The JSON schema identifier [string] (nil)
@@ -17,7 +17,7 @@ module KwalifyToJsonSchema
17
17
  DESCRIPTION # The JSON schema description. If not given the Kwalify description will be used if present [string] (nil)
18
18
  ISSUES_TO_DESCRIPTION # To append the issuses to the JSON schema description [boolean] (false)
19
19
  CUSTOM_PROCESSING # To customize the conversion [object] (nil)
20
- SCHEMA_VERSION # JSON schema version. Changing this value only change the value of $schema field[String] ("draft-04")
20
+ SCHEMA_VERSION # JSON schema version. Changing this value only change the value of $schema field[string] ("draft-04")
21
21
  )
22
22
 
23
23
  # The options as Hash
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kwalify_to_json_schema
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sylvain Gamot
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-10 00:00:00.000000000 Z
11
+ date: 2020-06-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor