swagger_yard 1.1.0 → 1.1.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 +17 -0
- data/lib/swagger_yard/api_group.rb +2 -0
- data/lib/swagger_yard/configuration.rb +2 -0
- data/lib/swagger_yard/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 503b5e749f9f3e40431798185264f5d830923d1117eaf19e53ffa4069b4db54e
|
4
|
+
data.tar.gz: 748debe18cb7958200d2e690ab7b6e0b36ef153bfcdb48c5283bb0687ba57246
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ace4ee34ecfa50bb06376789fed0770f52c7c58367452db1f701a69a29564c2a609c5d07b51d571c796f5820a80453f0382b81821bcb525bfa48cdf707195599
|
7
|
+
data.tar.gz: e7aa50665d8d8ef371414e885bce55986819be74fe782e4576b8d1c129539f7638c6c3767f85d56ec3ff8919c4d45d42d8162ae162514723b02de60d46e39614
|
data/README.md
CHANGED
@@ -32,6 +32,11 @@ Place configuration in a Rails initializer or suitable configuration file:
|
|
32
32
|
|
33
33
|
# Where to find models (can be an array)
|
34
34
|
config.model_path = ::Rails.root + 'app/decorators/**/*'
|
35
|
+
|
36
|
+
# Whether to include controller methods marked as private
|
37
|
+
# (either with ruby `private` or YARD `# @visibility private`
|
38
|
+
# Default: true
|
39
|
+
config.include_private = true
|
35
40
|
end
|
36
41
|
|
37
42
|
Then start to annotate controllers and models as described below.
|
@@ -108,6 +113,18 @@ class Accounts::OwnershipsController < ActionController::Base
|
|
108
113
|
end
|
109
114
|
```
|
110
115
|
|
116
|
+
#### Private controllers/actions
|
117
|
+
|
118
|
+
When you set `include_private = false` in the SwaggerYard configuration, you can mark action methods as private, so that they won't be documented, using `@visibility private` in comments.
|
119
|
+
|
120
|
+
```ruby
|
121
|
+
##
|
122
|
+
# @visibility private
|
123
|
+
def show
|
124
|
+
end
|
125
|
+
```
|
126
|
+
|
127
|
+
|
111
128
|
### Model ###
|
112
129
|
|
113
130
|
Each model to be exposed in the specification must have a `@model` tag. Model properties are specified with `@property` tags. JSON Schema `additionalProperties` can be specified with `@additional_properties <type>` where `<type>` is any type defined elsewhere, or simply `false` to denote a closed model (`additionalProperties: false`).
|
@@ -6,6 +6,7 @@ module SwaggerYard
|
|
6
6
|
attr_accessor :controller_path, :model_path
|
7
7
|
attr_accessor :path_discovery_function
|
8
8
|
attr_accessor :security_definitions
|
9
|
+
attr_accessor :include_private
|
9
10
|
|
10
11
|
# openapi-compatible names
|
11
12
|
alias openapi_version swagger_version
|
@@ -20,6 +21,7 @@ module SwaggerYard
|
|
20
21
|
@description = "Configure description with SwaggerYard.config.description"
|
21
22
|
@security_definitions = {}
|
22
23
|
@external_schema = {}
|
24
|
+
@include_private = true
|
23
25
|
end
|
24
26
|
|
25
27
|
def external_schema(mappings = nil)
|
data/lib/swagger_yard/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: swagger_yard
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- chtrinh (Chris Trinh)
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-10-
|
11
|
+
date: 2021-10-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: yard
|