rodauth-openapi 0.1.1 → 0.2.0
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/lib/rodauth/openapi/routes.rb +19 -1
 - data/rodauth-openapi.gemspec +1 -1
 - metadata +3 -6
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 4207f312e3af2d9d0ff8cd56091d559e53ed4ca6bc2467929560c58c6a2617ff
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 29b35acd6163236b9db240a10af6aa69691ec325ceec52043c52eb6ef61c1ee3
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: c83451cfe842f8b736641d290daf3f0e5fdbff72b870d11133edef34923618dd18f49e1e2c574e6cb6452be51e85cd142c6aeb7761a65cc750c26e141e042c51
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 519489230cb1ff5030635bbbcc26cc5bbde32d82c94d4a39a71d95b567bf6ca2e48ec5f253e34cf7e85cbd9e8e70311791fcee46599a288d2e8f8f75ad2f9971
         
     | 
| 
         @@ -46,6 +46,15 @@ module Rodauth 
     | 
|
| 
       46 
46 
     | 
    
         
             
                    data[:paths][path][verb] = {
         
     | 
| 
       47 
47 
     | 
    
         
             
                      tags: [tag],
         
     | 
| 
       48 
48 
     | 
    
         
             
                      summary: summary,
         
     | 
| 
      
 49 
     | 
    
         
            +
                      description: <<~MARKDOWN,
         
     | 
| 
      
 50 
     | 
    
         
            +
                        ```ruby
         
     | 
| 
      
 51 
     | 
    
         
            +
                        #{rodauth_invocation}.#{name}_route #=> "#{rodauth.send(:"#{name}_route")}"
         
     | 
| 
      
 52 
     | 
    
         
            +
                        #{rodauth_invocation}.#{name}_path #=> "#{path}"
         
     | 
| 
      
 53 
     | 
    
         
            +
                        #{rodauth_invocation}.#{name}_url #=> "https://example.com#{path}"
         
     | 
| 
      
 54 
     | 
    
         
            +
             
     | 
| 
      
 55 
     | 
    
         
            +
                        #{rodauth_invocation}.current_route #=> :#{name} (in the request)
         
     | 
| 
      
 56 
     | 
    
         
            +
                        ```
         
     | 
| 
      
 57 
     | 
    
         
            +
                      MARKDOWN
         
     | 
| 
       49 
58 
     | 
    
         
             
                      responses: {},
         
     | 
| 
       50 
59 
     | 
    
         
             
                      parameters: [],
         
     | 
| 
       51 
60 
     | 
    
         
             
                    }
         
     | 
| 
         @@ -54,7 +63,8 @@ module Rodauth 
     | 
|
| 
       54 
63 
     | 
    
         
             
                  end
         
     | 
| 
       55 
64 
     | 
    
         | 
| 
       56 
65 
     | 
    
         
             
                  def description(text)
         
     | 
| 
       57 
     | 
    
         
            -
                    data[:paths].values.last.values.last 
     | 
| 
      
 66 
     | 
    
         
            +
                    path = data[:paths].values.last.values.last
         
     | 
| 
      
 67 
     | 
    
         
            +
                    path[:description] = [path[:description], text].compact.join("\n")
         
     | 
| 
       58 
68 
     | 
    
         
             
                  end
         
     | 
| 
       59 
69 
     | 
    
         | 
| 
       60 
70 
     | 
    
         
             
                  def param(name, description, type:, example: nil, required: false, enum: nil)
         
     | 
| 
         @@ -124,6 +134,14 @@ module Rodauth 
     | 
|
| 
       124 
134 
     | 
    
         
             
                  def feature?(name)
         
     | 
| 
       125 
135 
     | 
    
         
             
                    rodauth.features.include?(name)
         
     | 
| 
       126 
136 
     | 
    
         
             
                  end
         
     | 
| 
      
 137 
     | 
    
         
            +
             
     | 
| 
      
 138 
     | 
    
         
            +
                  def rodauth_invocation
         
     | 
| 
      
 139 
     | 
    
         
            +
                    if rodauth.class.configuration_name
         
     | 
| 
      
 140 
     | 
    
         
            +
                      "rodauth(:#{rodauth.class.configuration_name})"
         
     | 
| 
      
 141 
     | 
    
         
            +
                    else
         
     | 
| 
      
 142 
     | 
    
         
            +
                      "rodauth"
         
     | 
| 
      
 143 
     | 
    
         
            +
                    end
         
     | 
| 
      
 144 
     | 
    
         
            +
                  end
         
     | 
| 
       127 
145 
     | 
    
         
             
                end
         
     | 
| 
       128 
146 
     | 
    
         
             
              end
         
     | 
| 
       129 
147 
     | 
    
         
             
            end
         
     | 
    
        data/rodauth-openapi.gemspec
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,13 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: rodauth-openapi
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.2.0
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Janko Marohnić
         
     | 
| 
       8 
     | 
    
         
            -
            autorequire:
         
     | 
| 
       9 
8 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
9 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2024- 
     | 
| 
      
 10 
     | 
    
         
            +
            date: 2024-12-29 00:00:00.000000000 Z
         
     | 
| 
       12 
11 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
12 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
13 
     | 
    
         
             
              name: rodauth
         
     | 
| 
         @@ -64,7 +63,6 @@ homepage: https://github.com/janko/rodauth-openapi 
     | 
|
| 
       64 
63 
     | 
    
         
             
            licenses:
         
     | 
| 
       65 
64 
     | 
    
         
             
            - MIT
         
     | 
| 
       66 
65 
     | 
    
         
             
            metadata: {}
         
     | 
| 
       67 
     | 
    
         
            -
            post_install_message:
         
     | 
| 
       68 
66 
     | 
    
         
             
            rdoc_options: []
         
     | 
| 
       69 
67 
     | 
    
         
             
            require_paths:
         
     | 
| 
       70 
68 
     | 
    
         
             
            - lib
         
     | 
| 
         @@ -79,8 +77,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement 
     | 
|
| 
       79 
77 
     | 
    
         
             
                - !ruby/object:Gem::Version
         
     | 
| 
       80 
78 
     | 
    
         
             
                  version: '0'
         
     | 
| 
       81 
79 
     | 
    
         
             
            requirements: []
         
     | 
| 
       82 
     | 
    
         
            -
            rubygems_version: 3. 
     | 
| 
       83 
     | 
    
         
            -
            signing_key:
         
     | 
| 
      
 80 
     | 
    
         
            +
            rubygems_version: 3.6.2
         
     | 
| 
       84 
81 
     | 
    
         
             
            specification_version: 4
         
     | 
| 
       85 
82 
     | 
    
         
             
            summary: Allows dynamically generating OpenAPI documentation based on Rodauth configuration.
         
     | 
| 
       86 
83 
     | 
    
         
             
            test_files: []
         
     |