You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
More docs, options, output, and error improvements
Use an alternate TOML formatter that handles arrays of
long strings much better.
Support @ as a command-line argument prefix indicating
a file from whic to read options
Copy file name to clipboardexpand all lines: README.md
+62-18
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,12 @@
3
3
This repository contains the OpenAPI Compliance Project, the first
4
4
piece of which is the OpenAPI Specification Compliance Parser.
5
5
6
+
The `oascomply` command-line tool takes an API description, as a single document or as several documents linked by JSON References (`$ref`) and indicates whether or not it is syntactically and semantically valid. It can optionally serialize an RDF graph of the parsed API description to `stdout` in any format supported by `rdflib`, as well as a custom format intended to be more human-readable.
7
+
8
+
The `oas30-schema` command-line tool is an OAS 3.0-specific JSON Schema implementation, based on the `jschon` implementation.
9
+
10
+
## Status
11
+
6
12
The OAS Compliance Parser is expected to reach 1.0 status by
7
13
late 2023. The current status of the project is
8
14
[pre-Milestone 1](https://tinyurl.com/4kth84k8).
@@ -187,13 +193,20 @@ line-oriented format known as
187
193
most RDF-based tools, but is also simple enough to be parsed directly
188
194
by a regular expression, which can be found in the `oascomply.reparse` module.
189
195
190
-
To print the graph to stdout, use the `-o` option without an argument
191
-
(diagnostic messages such as "Your API description is valid!" are printed
192
-
to stderr). We'll set a short HTTPS URI as it's less noisy than full
193
-
filesystem paths.
196
+
To print the graph to stdout, use the `-o` option without an argument.
197
+
Here, we redirect it to a `.nt` file, which is the standard N-Triples
198
+
file extension (diagnostic messages such as
199
+
"Your API description is valid!" are printed to stderr). We'll set a short
200
+
HTTPS URI as it's less noisy than full filesystem paths:
The `.` terminates the line, and is mostly there to make this format
@@ -311,10 +325,10 @@ Since the same node can appear in either the subject or object position in
311
325
many triples, these lines in the output connect through shared nodes to form
312
326
a graph:
313
327
314
-
```
315
-
<a> <x> <b>
316
-
<b> <y> <c>
317
-
<a> <z> "d"
328
+
```TTL
329
+
<a> <x> <b> .
330
+
<b> <y> <c> .
331
+
<a> <z> "d" .
318
332
```
319
333
320
334
This is a graph with three nodes, `<a>`, `<b>`, and `<c>`, with edges
@@ -348,7 +362,37 @@ OpenAPI concepts use the following namespace:
348
362
349
363
For OpenAPI object types, a version prefix, e.g. `3.0-Schema`, is part of the fragment. For relationships, including object fields with string, number, or boolean values, there is no version prefix. _(This may not remain the case, it will depend on feedback).
350
364
351
-
_**TODO:** Document human-friendly TOML format properly._
365
+
## Reading the experimental TOML output
366
+
367
+
The TOML output format is an experiment in providing something a little
368
+
more intuitive. Here's a portion of the earlier example for reference:
* The first section, `[namespaces]`, defines the short names for each namespace, and the URI prefix the short name represents
389
+
* The remaining section headings are subjects in the RDF triples
390
+
* Under each heading, the keys are predicates (relationships) and the values are objects, forming a triple with the subject in the heading
391
+
* String literal object values are one-element arrays
392
+
* Typed literal object values are two-element arrays, with the datatype as the second element
393
+
* Multiple objects for the same subject and predicate appear as arrays
394
+
395
+
While the two different uses of arrays is somewhat ambiguous for the two-element array case, in practice datatypes tend to be very recognizable. However, feedback on this is encouraged.
0 commit comments