lutaml-jsonschema 0.1.8 → 0.1.9

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: eea2d4379420899294e19ce129230527927e0af75f6d7f3aad847edc14a1072b
4
- data.tar.gz: 71831392b43dc29bed8c8da35da7b021eaf2ed2c377e90b0b949e23e8747df43
3
+ metadata.gz: d756394e76dba6d56e58308f5b5bf05dee2426f3ed1f06741db6d42e2b9b0722
4
+ data.tar.gz: 1dda2ab2e8d89fc28c62df3a278d4bba0ef3e0bcb21a38176fc3816c4922927d
5
5
  SHA512:
6
- metadata.gz: 52c2b48f8a08223efc1926a18d5260e983d40359c2b5935a2a6962fc0260ff87ddfb7d88d2b4598072d66950ce999b89017afbf2ef9dbbac523b48722cffa336
7
- data.tar.gz: b9f3b9ae250242f212d5fd59d99497f75143cbca89b079c9a64f476e582cd66ab4cdbd71a9cd8a905f2642b5625071464e86c8de019703119bd2e639f06f7c39
6
+ metadata.gz: 24cc7e89987cd5d49cf5bda35a6a43af05f6de286755d2f324128eca05d643972095eb56d9375406f714ebf11f2b5731563d02f2c8a20f6972fc056ba0727b94
7
+ data.tar.gz: 9d65c1d9e86e2321d561f5853ac2d1617231b267f0ff0d32dbeab6e28f6b4067ecf1fc5fa8458df7db49fbe6dc4fc0e6cf8664abaf5f4a714b7a48cb3ca2442c
@@ -34,35 +34,35 @@
34
34
  <span class="meta-label">Type</span>
35
35
  <span class="badge badge-type">{{ itemType }}</span>
36
36
  </div>
37
- <div v-if="item.kind === 'property' && (item as any).property.format" class="meta-row">
37
+ <div v-if="propertyItem?.format" class="meta-row">
38
38
  <span class="meta-label">Format</span>
39
- <span class="badge badge-format">{{ (item as any).property.format }}</span>
39
+ <span class="badge badge-format">{{ propertyItem.format }}</span>
40
40
  </div>
41
41
  <div v-if="itemDescription" class="meta-row">
42
42
  <span class="meta-label">Description</span>
43
43
  <span class="text-secondary">{{ itemDescription }}</span>
44
44
  </div>
45
- <div v-if="item.kind === 'property'" class="meta-row">
45
+ <div v-if="propertyItem" class="meta-row">
46
46
  <span class="meta-label">Required</span>
47
- <span :class="['badge', (item as any).property.required ? 'badge-required' : 'badge-optional']">
48
- {{ (item as any).property.required ? 'Yes' : 'No' }}
47
+ <span :class="['badge', propertyItem.required ? 'badge-required' : 'badge-optional']">
48
+ {{ propertyItem.required ? 'Yes' : 'No' }}
49
49
  </span>
50
50
  </div>
51
- <div v-if="item.kind === 'property' && (item as any).property.deprecated" class="meta-row">
51
+ <div v-if="propertyItem?.deprecated" class="meta-row">
52
52
  <span class="meta-label">Status</span>
53
53
  <span class="badge badge-deprecated">Deprecated</span>
54
54
  </div>
55
- <div v-if="item.kind === 'property' && (item as any).property.ref" class="meta-row">
55
+ <div v-if="propertyItem?.ref" class="meta-row">
56
56
  <span class="meta-label">Reference</span>
57
- <span class="font-mono text-secondary">{{ (item as any).property.ref }}</span>
57
+ <span class="font-mono text-secondary">{{ propertyItem.ref }}</span>
58
58
  </div>
59
- <div v-if="item.kind === 'property' && (item as any).property.compositionSource" class="meta-row">
59
+ <div v-if="propertyItem?.compositionSource" class="meta-row">
60
60
  <span class="meta-label">Source</span>
61
- <span class="badge badge-composition-detail">{{ (item as any).property.compositionSource }}</span>
61
+ <span class="badge badge-composition-detail">{{ propertyItem.compositionSource }}</span>
62
62
  </div>
63
- <div v-if="item.kind === 'property' && (item as any).property.default" class="meta-row">
63
+ <div v-if="propertyItem?.default" class="meta-row">
64
64
  <span class="meta-label">Default</span>
65
- <span class="font-mono">{{ (item as any).property.default }}</span>
65
+ <span class="font-mono">{{ propertyItem.default }}</span>
66
66
  </div>
67
67
  <div v-if="item.kind === 'schema' && schema.required.length" class="meta-row">
68
68
  <span class="meta-label">Required</span>
@@ -102,75 +102,75 @@
102
102
  </div>
103
103
 
104
104
  <!-- Constraints for property -->
105
- <div v-if="item.kind === 'property' && hasConstraints" class="detail-section">
105
+ <div v-if="propertyItem && hasConstraints" class="detail-section">
106
106
  <h3 class="detail-heading">Constraints</h3>
107
107
  <table class="table constraint-table">
108
108
  <tbody>
109
- <tr v-if="(item as any).property.minimum != null">
109
+ <tr v-if="propertyItem.minimum != null">
110
110
  <td class="constraint-key">Minimum</td>
111
- <td>{{ (item as any).property.minimum }}</td>
111
+ <td>{{ propertyItem.minimum }}</td>
112
112
  </tr>
113
- <tr v-if="(item as any).property.maximum != null">
113
+ <tr v-if="propertyItem.maximum != null">
114
114
  <td class="constraint-key">Maximum</td>
115
- <td>{{ (item as any).property.maximum }}</td>
115
+ <td>{{ propertyItem.maximum }}</td>
116
116
  </tr>
117
- <tr v-if="(item as any).property.minLength != null">
117
+ <tr v-if="propertyItem.minLength != null">
118
118
  <td class="constraint-key">Min Length</td>
119
- <td>{{ (item as any).property.minLength }}</td>
119
+ <td>{{ propertyItem.minLength }}</td>
120
120
  </tr>
121
- <tr v-if="(item as any).property.maxLength != null">
121
+ <tr v-if="propertyItem.maxLength != null">
122
122
  <td class="constraint-key">Max Length</td>
123
- <td>{{ (item as any).property.maxLength }}</td>
123
+ <td>{{ propertyItem.maxLength }}</td>
124
124
  </tr>
125
- <tr v-if="(item as any).property.pattern">
125
+ <tr v-if="propertyItem.pattern">
126
126
  <td class="constraint-key">Pattern</td>
127
- <td class="font-mono">{{ (item as any).property.pattern }}</td>
127
+ <td class="font-mono">{{ propertyItem.pattern }}</td>
128
128
  </tr>
129
- <tr v-if="(item as any).property.enum?.length">
129
+ <tr v-if="propertyItem.enum?.length">
130
130
  <td class="constraint-key">Enum</td>
131
- <td>{{ (item as any).property.enum.join(', ') }}</td>
131
+ <td>{{ propertyItem.enum.join(', ') }}</td>
132
132
  </tr>
133
- <tr v-if="(item as any).property.itemsType">
133
+ <tr v-if="propertyItem.itemsType">
134
134
  <td class="constraint-key">Items</td>
135
- <td>{{ (item as any).property.itemsType }}</td>
135
+ <td>{{ propertyItem.itemsType }}</td>
136
136
  </tr>
137
- <tr v-if="(item as any).property.exclusiveMinimum != null">
137
+ <tr v-if="propertyItem.exclusiveMinimum != null">
138
138
  <td class="constraint-key">Exclusive Min</td>
139
- <td>{{ (item as any).property.exclusiveMinimum }}</td>
139
+ <td>{{ propertyItem.exclusiveMinimum }}</td>
140
140
  </tr>
141
- <tr v-if="(item as any).property.exclusiveMaximum != null">
141
+ <tr v-if="propertyItem.exclusiveMaximum != null">
142
142
  <td class="constraint-key">Exclusive Max</td>
143
- <td>{{ (item as any).property.exclusiveMaximum }}</td>
143
+ <td>{{ propertyItem.exclusiveMaximum }}</td>
144
144
  </tr>
145
- <tr v-if="(item as any).property.minItems != null">
145
+ <tr v-if="propertyItem.minItems != null">
146
146
  <td class="constraint-key">Min Items</td>
147
- <td>{{ (item as any).property.minItems }}</td>
147
+ <td>{{ propertyItem.minItems }}</td>
148
148
  </tr>
149
- <tr v-if="(item as any).property.maxItems != null">
149
+ <tr v-if="propertyItem.maxItems != null">
150
150
  <td class="constraint-key">Max Items</td>
151
- <td>{{ (item as any).property.maxItems }}</td>
151
+ <td>{{ propertyItem.maxItems }}</td>
152
152
  </tr>
153
- <tr v-if="(item as any).property.uniqueItems">
153
+ <tr v-if="propertyItem.uniqueItems">
154
154
  <td class="constraint-key">Unique Items</td>
155
155
  <td>Yes</td>
156
156
  </tr>
157
- <tr v-if="(item as any).property.multipleOf != null">
157
+ <tr v-if="propertyItem.multipleOf != null">
158
158
  <td class="constraint-key">Multiple Of</td>
159
- <td>{{ (item as any).property.multipleOf }}</td>
159
+ <td>{{ propertyItem.multipleOf }}</td>
160
160
  </tr>
161
- <tr v-if="(item as any).property.const != null">
161
+ <tr v-if="propertyItem.const != null">
162
162
  <td class="constraint-key">Const</td>
163
- <td class="font-mono">{{ (item as any).property.const }}</td>
163
+ <td class="font-mono">{{ propertyItem.const }}</td>
164
164
  </tr>
165
- <tr v-if="(item as any).property.contentMediaType">
165
+ <tr v-if="propertyItem.contentMediaType">
166
166
  <td class="constraint-key">Content Type</td>
167
- <td>{{ (item as any).property.contentMediaType }}</td>
167
+ <td>{{ propertyItem.contentMediaType }}</td>
168
168
  </tr>
169
- <tr v-if="(item as any).property.contentEncoding">
169
+ <tr v-if="propertyItem.contentEncoding">
170
170
  <td class="constraint-key">Content Encoding</td>
171
- <td>{{ (item as any).property.contentEncoding }}</td>
171
+ <td>{{ propertyItem.contentEncoding }}</td>
172
172
  </tr>
173
- <tr v-if="(item as any).property.additionalProperties === false">
173
+ <tr v-if="propertyItem.additionalProperties === false">
174
174
  <td class="constraint-key">Additional Props</td>
175
175
  <td>Denied</td>
176
176
  </tr>
@@ -296,8 +296,8 @@ function formatExample(value: unknown): string {
296
296
  }
297
297
 
298
298
  const hasConstraints = computed(() => {
299
- if (item.value?.kind !== 'property') return false
300
- const p = item.value.property
299
+ const p = propertyItem.value
300
+ if (!p) return false
301
301
  return p.minimum != null || p.maximum != null ||
302
302
  p.minLength != null || p.maxLength != null ||
303
303
  p.pattern || p.enum?.length || p.itemsType ||
@@ -374,6 +374,11 @@ const currentTabs = computed<{ id: TabId; label: string }[]>(() => {
374
374
  }
375
375
  return tabs
376
376
  })
377
+
378
+ const propertyItem = computed<SpaProperty | null>(() => {
379
+ if (item.value?.kind !== 'property') return null
380
+ return item.value.property
381
+ })
377
382
  </script>
378
383
 
379
384
  <style scoped>
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Lutaml
4
4
  module Jsonschema
5
- VERSION = "0.1.8"
5
+ VERSION = "0.1.9"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lutaml-jsonschema
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.