metanorma-plugin-openapi 0.1.1 → 0.1.2
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 +4 -4
- data/CHANGELOG.md +21 -0
- data/LICENSE.md +33 -0
- data/README.md +19 -0
- data/lib/metanorma/plugin/openapi/renderer.rb +26 -1
- data/lib/metanorma/plugin/openapi/version.rb +1 -1
- metadata +9 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 42d3ee8a020d3ea33aaf1259d38beee0578edc6eb0cbd3e15adfd1c6e8bfb3ee
|
|
4
|
+
data.tar.gz: f9803b8deb664d9c183df067aa7dd4853709ef8c561b8ba9551a659637681b7c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 21c95c754c239c753cc1bca268fe1c6ef234aa86ee5a85f6d7e32bdcc81974f2bda9db9b071f22d46dc129d68264f7f0417db8df3cb626ac0dcbf63638e8977f
|
|
7
|
+
data.tar.gz: 5fbe6ab4c1806c7818081e53b3a64c49f2a670bd8435339a55f34f5beea9fe71c6bbab4d676b3de9b56003ea5b628215dc73b7232860ad1e420925100e1a77cc
|
data/CHANGELOG.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are documented in this file.
|
|
4
|
+
|
|
5
|
+
## [0.1.1] - 2026-10-26
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- The coradoc monorepo is an optional enhancement: soft-require it and pass CommonMark descriptions through with only the link bridge when absent (metanorma-plugin-lutaml pins coradoc ~> 1.1.8, excluding the 2.0 hub from metanorma-cli bundles).
|
|
10
|
+
- Resolve `Lutaml::Openapi` against the top level — metanorma-plugin-lutaml's namespace lexically shadowed the lookup, crashing every metanorma-cli bundle.
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- Splice rendered sections through an Asciidoctor **preprocessor** instead of a block: the preprocessor is the only mechanism that yields real sections (numbering, TOC); the renderer's preface drops to `==` level.
|
|
15
|
+
- Render operation **summaries** as well as descriptions (most corpora carry summary alone).
|
|
16
|
+
|
|
17
|
+
## [0.1.0] - 2026-10-24
|
|
18
|
+
|
|
19
|
+
### Added
|
|
20
|
+
|
|
21
|
+
- First release: the `[openapi,path=...]` block, the AsyncAPI-style preprocessor splice and the section renderer over lutaml-openapi.
|
data/LICENSE.md
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
Licenses & Copyright
|
|
2
|
+
====================
|
|
3
|
+
|
|
4
|
+
This license file adheres to the formatting guidelines of
|
|
5
|
+
[readable-licenses](https://github.com/nevir/readable-licenses).
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
Ribose's BSD 2-Clause License
|
|
9
|
+
-----------------------------
|
|
10
|
+
|
|
11
|
+
Copyright (c) 2026, [Ribose Inc](https://www.ribose.com).
|
|
12
|
+
All rights reserved.
|
|
13
|
+
|
|
14
|
+
Redistribution and use in source and binary forms, with or without modification,
|
|
15
|
+
are permitted provided that the following conditions are met:
|
|
16
|
+
|
|
17
|
+
1. Redistributions of source code must retain the above copyright notice,
|
|
18
|
+
this list of conditions and the following disclaimer.
|
|
19
|
+
|
|
20
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
21
|
+
this list of conditions and the following disclaimer in the documentation
|
|
22
|
+
and/or other materials provided with the distribution.
|
|
23
|
+
|
|
24
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
25
|
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
26
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
27
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
|
|
28
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
29
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
30
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
31
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
32
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
33
|
+
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
data/README.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# metanorma-plugin-openapi
|
|
2
|
+
|
|
3
|
+
Renders [OpenAPI](https://spec.openapis.org) documents as normative
|
|
4
|
+
Metanorma sections — the `[openapi,path=...]` preprocessor and renderer
|
|
5
|
+
over [lutaml-openapi](https://github.com/lutaml/lutaml-openapi).
|
|
6
|
+
|
|
7
|
+
```adoc
|
|
8
|
+
[openapi,path=openapi.yaml]
|
|
9
|
+
--
|
|
10
|
+
--
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
The splice runs as an Asciidoctor preprocessor, so the rendered
|
|
14
|
+
schemas, operations and property tables become real numbered sections
|
|
15
|
+
of the document (TOC and cross-references included).
|
|
16
|
+
|
|
17
|
+
CommonMark descriptions are converted to AsciiDoc through the coradoc
|
|
18
|
+
monorepo when present; otherwise they pass through with the inline
|
|
19
|
+
link bridge applied.
|
|
@@ -62,7 +62,32 @@ module Metanorma
|
|
|
62
62
|
lines << to_asciidoc(desc) << ""
|
|
63
63
|
end
|
|
64
64
|
lines << "Type: `#{schema.type}`" << "" if schema.type
|
|
65
|
-
lines
|
|
65
|
+
lines.concat(property_table(schema, name))
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
def property_table(schema, name)
|
|
69
|
+
entries = schema.property_entries
|
|
70
|
+
return [] if entries.nil? || entries.empty?
|
|
71
|
+
|
|
72
|
+
rows = entries.sort_by(&:name).map { |entry| property_row(entry) }
|
|
73
|
+
[".Properties of #{name}",
|
|
74
|
+
"[cols=\"2,1,7\",options=\"header\"]",
|
|
75
|
+
"|===",
|
|
76
|
+
"|Name |Type |Description",
|
|
77
|
+
*rows,
|
|
78
|
+
"|===",
|
|
79
|
+
""]
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
def property_row(entry)
|
|
83
|
+
schema = entry.schema
|
|
84
|
+
"|#{entry.name} |`#{schema&.type}` |#{cell(schema&.description)}"
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
# table cells take plain text: escape the cell delimiter and
|
|
88
|
+
# flatten the (CommonMark) description to one line
|
|
89
|
+
def cell(text)
|
|
90
|
+
(text || "").gsub("|", "\\|").gsub(/\s+/, " ").strip
|
|
66
91
|
end
|
|
67
92
|
|
|
68
93
|
def paths_section
|
metadata
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: metanorma-plugin-openapi
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
8
|
+
autorequire:
|
|
8
9
|
bindir: bin
|
|
9
10
|
cert_chain: []
|
|
10
|
-
date:
|
|
11
|
+
date: 2026-10-28 00:00:00.000000000 Z
|
|
11
12
|
dependencies:
|
|
12
13
|
- !ruby/object:Gem::Dependency
|
|
13
14
|
name: asciidoctor
|
|
@@ -60,9 +61,12 @@ extensions: []
|
|
|
60
61
|
extra_rdoc_files: []
|
|
61
62
|
files:
|
|
62
63
|
- ".rubocop_todo.yml"
|
|
64
|
+
- CHANGELOG.md
|
|
63
65
|
- CODE_OF_CONDUCT.md
|
|
64
66
|
- LICENSE
|
|
67
|
+
- LICENSE.md
|
|
65
68
|
- README.adoc
|
|
69
|
+
- README.md
|
|
66
70
|
- Rakefile
|
|
67
71
|
- examples/ogcapi-features-1.adoc
|
|
68
72
|
- lib/metanorma/plugin/openapi.rb
|
|
@@ -74,6 +78,7 @@ licenses:
|
|
|
74
78
|
- BSD-2-Clause
|
|
75
79
|
metadata:
|
|
76
80
|
rubygems_mfa_required: 'true'
|
|
81
|
+
post_install_message:
|
|
77
82
|
rdoc_options: []
|
|
78
83
|
require_paths:
|
|
79
84
|
- lib
|
|
@@ -88,7 +93,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
88
93
|
- !ruby/object:Gem::Version
|
|
89
94
|
version: '0'
|
|
90
95
|
requirements: []
|
|
91
|
-
rubygems_version: 3.
|
|
96
|
+
rubygems_version: 3.5.22
|
|
97
|
+
signing_key:
|
|
92
98
|
specification_version: 4
|
|
93
99
|
summary: Metanorma plugin for OpenAPI
|
|
94
100
|
test_files: []
|