oas_core 0.4.0 → 0.5.1
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/README.md +7 -4
- data/lib/oas_core/builders/operation_builder.rb +4 -3
- data/lib/oas_core/builders/parameters_builder.rb +1 -1
- data/lib/oas_core/version.rb +1 -1
- data/lib/oas_core.rb +1 -1
- metadata +15 -2
- data/lib/oas_core/string.rb +0 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 202ef79c5565fcd8d1c8443267f718d006dc8daa4abb8dd50b08863e8c06af80
|
4
|
+
data.tar.gz: 0b0c223a44e635e63f28e4e0e268ebba99efde363d2f83fad7446af3a299d8f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2dcd7323e5ce3566d7292790bff07e84a33a608c181d70cf9bbf822cb15a362ea98dcdc85496145a5e1187d3a1b765a52e6a51e4215cc4da7ec40bce9c04ad5d
|
7
|
+
data.tar.gz: 871a04fe56856868ce4d8927ddfd62e3a20dcd8cf87af11e276ccc7c132d2884876edeaf536fee251b5e57f6a4b5f2bc9a4c31bde6459fc5a4235426782fa573
|
data/README.md
CHANGED
@@ -1,13 +1,16 @@
|
|
1
1
|

|
2
2
|

|
3
|
-

|
4
4
|

|
5
|
-

|
6
5
|

|
7
6
|
|
8
|
-
# 📃Open API Specification
|
7
|
+
# 📃Open API Specification Core
|
9
8
|
|
10
|
-
|
9
|
+
OasCore is a Ruby gem designed to generate Open API Specification (OAS) 3.1 documentation directly from YARD comments in your endpoints. It serves as the core engine for OAS generation, while framework-specific adapters like `OasRails` (for Ruby on Rails) handle the extraction, integration and additional features.
|
10
|
+
|
11
|
+
## Framework adapters
|
12
|
+
|
13
|
+
- **[OasRails](https://github.com/a-chacon/oas_rails)**
|
11
14
|
|
12
15
|
## Documentation
|
13
16
|
|
@@ -30,8 +30,9 @@ module OasCore
|
|
30
30
|
private
|
31
31
|
|
32
32
|
def extract_summary(oas_route:)
|
33
|
-
oas_route.tags(:summary).first
|
34
|
-
|
33
|
+
summary_tag = oas_route.tags(:summary).first
|
34
|
+
summary_tag&.text || generate_crud_name(oas_route.method_name,
|
35
|
+
oas_route.controller.downcase) || "#{oas_route.verb} #{oas_route.path}"
|
35
36
|
end
|
36
37
|
|
37
38
|
def extract_operation_id(oas_route:)
|
@@ -50,7 +51,7 @@ module OasCore
|
|
50
51
|
def default_tags(oas_route:)
|
51
52
|
tags = []
|
52
53
|
if OasCore.config.default_tags_from == :namespace
|
53
|
-
tag = oas_route.path.split('/').reject(&:empty?).first
|
54
|
+
tag = oas_route.path.split('/').reject(&:empty?).first&.titleize
|
54
55
|
tags << tag unless tag.nil?
|
55
56
|
else
|
56
57
|
tags << oas_route.controller.gsub('/', ' ').titleize
|
@@ -11,7 +11,7 @@ module OasCore
|
|
11
11
|
def from_oas_route(oas_route)
|
12
12
|
parameters_from_tags(tags: oas_route.tags(:parameter))
|
13
13
|
|
14
|
-
oas_route.path_params
|
14
|
+
oas_route.path_params&.map do |p|
|
15
15
|
@parameters << ParameterBuilder.new(@specification).from_path(oas_route.path, p).build unless @parameters.any? { |param| param.name.to_s == p.to_s }
|
16
16
|
end
|
17
17
|
|
data/lib/oas_core/version.rb
CHANGED
data/lib/oas_core.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: oas_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- a-chacon
|
@@ -9,6 +9,20 @@ bindir: bin
|
|
9
9
|
cert_chain: []
|
10
10
|
date: 1980-01-02 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
|
+
- !ruby/object:Gem::Dependency
|
13
|
+
name: activesupport
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
15
|
+
requirements:
|
16
|
+
- - ">="
|
17
|
+
- !ruby/object:Gem::Version
|
18
|
+
version: '7.0'
|
19
|
+
type: :runtime
|
20
|
+
prerelease: false
|
21
|
+
version_requirements: !ruby/object:Gem::Requirement
|
22
|
+
requirements:
|
23
|
+
- - ">="
|
24
|
+
- !ruby/object:Gem::Version
|
25
|
+
version: '7.0'
|
12
26
|
- !ruby/object:Gem::Dependency
|
13
27
|
name: method_source
|
14
28
|
requirement: !ruby/object:Gem::Requirement
|
@@ -80,7 +94,6 @@ files:
|
|
80
94
|
- lib/oas_core/spec/specable.rb
|
81
95
|
- lib/oas_core/spec/specification.rb
|
82
96
|
- lib/oas_core/spec/tag.rb
|
83
|
-
- lib/oas_core/string.rb
|
84
97
|
- lib/oas_core/utils.rb
|
85
98
|
- lib/oas_core/version.rb
|
86
99
|
- lib/oas_core/yard/example_tag.rb
|