rapitapir 0.1.2 → 2.0.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/.rubocop.yml +7 -7
- data/.rubocop_todo.yml +83 -0
- data/README.md +1319 -235
- data/RUBY_WEEKLY_LAUNCH_POST.md +219 -0
- data/docs/RAILS_INTEGRATION_IMPLEMENTATION.md +209 -0
- data/docs/SINATRA_EXTENSION.md +399 -348
- data/docs/STRICT_VALIDATION.md +229 -0
- data/docs/VALIDATION_IMPROVEMENTS.md +218 -0
- data/docs/ai-integration-plan.md +112 -0
- data/docs/auto-derivation.md +505 -92
- data/docs/endpoint-definition.md +536 -129
- data/docs/n8n-integration.md +212 -0
- data/docs/observability.md +810 -500
- data/docs/using-mcp.md +93 -0
- data/examples/ai/knowledge_base_rag.rb +83 -0
- data/examples/ai/user_management_mcp.rb +92 -0
- data/examples/ai/user_validation_llm.rb +187 -0
- data/examples/rails/RAILS_8_GUIDE.md +165 -0
- data/examples/rails/RAILS_LOADING_FIX.rb +35 -0
- data/examples/rails/README.md +497 -0
- data/examples/rails/comprehensive_test.rb +91 -0
- data/examples/rails/config/routes.rb +48 -0
- data/examples/rails/debug_controller.rb +63 -0
- data/examples/rails/detailed_test.rb +46 -0
- data/examples/rails/enhanced_users_controller.rb +278 -0
- data/examples/rails/final_server_test.rb +50 -0
- data/examples/rails/hello_world_app.rb +116 -0
- data/examples/rails/hello_world_controller.rb +186 -0
- data/examples/rails/hello_world_routes.rb +28 -0
- data/examples/rails/rails8_minimal_demo.rb +132 -0
- data/examples/rails/rails8_simple_demo.rb +140 -0
- data/examples/rails/rails8_working_demo.rb +255 -0
- data/examples/rails/real_world_blog_api.rb +510 -0
- data/examples/rails/server_test.rb +46 -0
- data/examples/rails/test_direct_processing.rb +41 -0
- data/examples/rails/test_hello_world.rb +80 -0
- data/examples/rails/test_rails_integration.rb +54 -0
- data/examples/rails/traditional_app/Gemfile +37 -0
- data/examples/rails/traditional_app/README.md +265 -0
- data/examples/rails/traditional_app/app/controllers/api/v1/posts_controller.rb +254 -0
- data/examples/rails/traditional_app/app/controllers/api/v1/users_controller.rb +220 -0
- data/examples/rails/traditional_app/app/controllers/application_controller.rb +86 -0
- data/examples/rails/traditional_app/app/controllers/application_controller_simplified.rb +87 -0
- data/examples/rails/traditional_app/app/controllers/documentation_controller.rb +149 -0
- data/examples/rails/traditional_app/app/controllers/health_controller.rb +42 -0
- data/examples/rails/traditional_app/config/routes.rb +25 -0
- data/examples/rails/traditional_app/config/routes_best_practice.rb +25 -0
- data/examples/rails/traditional_app/config/routes_simplified.rb +36 -0
- data/examples/rails/traditional_app_runnable.rb +406 -0
- data/examples/rails/users_controller.rb +4 -1
- data/examples/serverless/Gemfile +43 -0
- data/examples/serverless/QUICKSTART.md +331 -0
- data/examples/serverless/README.md +520 -0
- data/examples/serverless/aws_lambda_example.rb +307 -0
- data/examples/serverless/aws_sam_template.yaml +215 -0
- data/examples/serverless/azure_functions_example.rb +407 -0
- data/examples/serverless/deploy.rb +204 -0
- data/examples/serverless/gcp_cloud_functions_example.rb +367 -0
- data/examples/serverless/gcp_function.yaml +23 -0
- data/examples/serverless/host.json +24 -0
- data/examples/serverless/package.json +32 -0
- data/examples/serverless/spec/aws_lambda_spec.rb +196 -0
- data/examples/serverless/spec/spec_helper.rb +89 -0
- data/examples/serverless/vercel.json +31 -0
- data/examples/serverless/vercel_example.rb +404 -0
- data/examples/strict_validation_examples.rb +104 -0
- data/examples/validation_error_examples.rb +173 -0
- data/lib/rapitapir/ai/llm_instruction.rb +456 -0
- data/lib/rapitapir/ai/mcp.rb +134 -0
- data/lib/rapitapir/ai/rag.rb +287 -0
- data/lib/rapitapir/ai/rag_middleware.rb +147 -0
- data/lib/rapitapir/auth/oauth2.rb +43 -57
- data/lib/rapitapir/cli/command.rb +362 -2
- data/lib/rapitapir/cli/mcp_export.rb +18 -0
- data/lib/rapitapir/cli/validator.rb +2 -6
- data/lib/rapitapir/core/endpoint.rb +59 -6
- data/lib/rapitapir/core/enhanced_endpoint.rb +2 -6
- data/lib/rapitapir/dsl/fluent_endpoint_builder.rb +53 -0
- data/lib/rapitapir/endpoint_registry.rb +47 -0
- data/lib/rapitapir/observability/health_check.rb +4 -4
- data/lib/rapitapir/observability/logging.rb +10 -10
- data/lib/rapitapir/schema.rb +2 -2
- data/lib/rapitapir/server/rack_adapter.rb +1 -3
- data/lib/rapitapir/server/rails/configuration.rb +77 -0
- data/lib/rapitapir/server/rails/controller_base.rb +185 -0
- data/lib/rapitapir/server/rails/documentation_helpers.rb +76 -0
- data/lib/rapitapir/server/rails/resource_builder.rb +181 -0
- data/lib/rapitapir/server/rails/routes.rb +114 -0
- data/lib/rapitapir/server/rails_adapter.rb +10 -3
- data/lib/rapitapir/server/rails_adapter_class.rb +1 -3
- data/lib/rapitapir/server/rails_controller.rb +1 -3
- data/lib/rapitapir/server/rails_integration.rb +67 -0
- data/lib/rapitapir/server/rails_response_handler.rb +16 -3
- data/lib/rapitapir/server/sinatra_adapter.rb +29 -5
- data/lib/rapitapir/server/sinatra_integration.rb +4 -4
- data/lib/rapitapir/sinatra/extension.rb +2 -2
- data/lib/rapitapir/sinatra/oauth2_helpers.rb +34 -40
- data/lib/rapitapir/types/array.rb +4 -0
- data/lib/rapitapir/types/auto_derivation.rb +4 -18
- data/lib/rapitapir/types/datetime.rb +1 -3
- data/lib/rapitapir/types/float.rb +2 -6
- data/lib/rapitapir/types/hash.rb +40 -2
- data/lib/rapitapir/types/integer.rb +4 -12
- data/lib/rapitapir/types/object.rb +6 -2
- data/lib/rapitapir/types.rb +6 -2
- data/lib/rapitapir/version.rb +1 -1
- data/lib/rapitapir.rb +5 -3
- metadata +74 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: deccb0d6ca9e591e3a2fab10940b4e177181fff12c6067297871388d33d5ce3e
|
4
|
+
data.tar.gz: 0f14ea824545c131ac9c45bcb5616a0b587de17d202a5050abaadbc7a4e044f8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d32fd597c0a5713999afa77a1e49d17899b23e9c1b1e5aeefded0690e7031a174b842f0147f2a6bce9755c6ebacdbe9b9be50d1c89c286f1c4cdf4689c8ab7d5
|
7
|
+
data.tar.gz: 1315df6e9d3797452453a990a6160244edea18175d9af913faf08494c9c7c5e154e6a5989a5979bdc2ad4c94f5eefb80a38863cf3ec6f2f76e63ec73177314a2
|
data/.rubocop.yml
CHANGED
@@ -1,6 +1,12 @@
|
|
1
1
|
# RuboCop configuration for RapiTapir
|
2
|
+
inherit_from: .rubocop_todo.yml
|
3
|
+
|
4
|
+
inherit_mode:
|
5
|
+
merge:
|
6
|
+
- Exclude
|
7
|
+
|
2
8
|
AllCops:
|
3
|
-
TargetRubyVersion: 3.
|
9
|
+
TargetRubyVersion: 3.1
|
4
10
|
NewCops: enable
|
5
11
|
SuggestExtensions: false
|
6
12
|
Exclude:
|
@@ -38,12 +44,6 @@ Style/ClassVars:
|
|
38
44
|
Exclude:
|
39
45
|
- 'spec/**/*'
|
40
46
|
|
41
|
-
# Line length is reasonable for API definitions
|
42
|
-
Layout/LineLength:
|
43
|
-
Max: 120
|
44
|
-
Exclude:
|
45
|
-
- 'spec/**/*'
|
46
|
-
|
47
47
|
# Disable some newer cops that may cause issues
|
48
48
|
Gemspec/AddRuntimeDependency:
|
49
49
|
Enabled: false
|
data/.rubocop_todo.yml
ADDED
@@ -0,0 +1,83 @@
|
|
1
|
+
# This configuration was generated by
|
2
|
+
# `rubocop --auto-gen-config`
|
3
|
+
# on 2025-08-07 14:11:39 UTC using RuboCop version 1.79.2.
|
4
|
+
# The point is for the user to remove these configuration records
|
5
|
+
# one by one as the offenses are removed from the code base.
|
6
|
+
# Note that changes in the inspected code, or installation of new
|
7
|
+
# versions of RuboCop, may require this file to be generated again.
|
8
|
+
|
9
|
+
# Offense count: 7
|
10
|
+
# This cop supports safe autocorrection (--autocorrect).
|
11
|
+
# Configuration parameters: AllowHeredoc, AllowURI, AllowQualifiedName, URISchemes, IgnoreCopDirectives, AllowedPatterns, SplitStrings.
|
12
|
+
# URISchemes: http, https
|
13
|
+
Layout/LineLength:
|
14
|
+
Max: 160
|
15
|
+
|
16
|
+
# Offense count: 3
|
17
|
+
# Configuration parameters: IgnoreLiteralBranches, IgnoreConstantBranches, IgnoreDuplicateElseBranch.
|
18
|
+
Lint/DuplicateBranch:
|
19
|
+
Exclude:
|
20
|
+
- 'lib/rapitapir/server/rails/routes.rb'
|
21
|
+
|
22
|
+
# Offense count: 19
|
23
|
+
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
|
24
|
+
Metrics/AbcSize:
|
25
|
+
Max: 48
|
26
|
+
|
27
|
+
# Offense count: 13
|
28
|
+
# Configuration parameters: AllowedMethods, AllowedPatterns.
|
29
|
+
Metrics/CyclomaticComplexity:
|
30
|
+
Max: 16
|
31
|
+
|
32
|
+
# Offense count: 7
|
33
|
+
# Configuration parameters: AllowedMethods, AllowedPatterns.
|
34
|
+
Metrics/PerceivedComplexity:
|
35
|
+
Max: 14
|
36
|
+
|
37
|
+
# Offense count: 1
|
38
|
+
Naming/AccessorMethodName:
|
39
|
+
Exclude:
|
40
|
+
- 'lib/rapitapir/auth/oauth2.rb'
|
41
|
+
|
42
|
+
# Offense count: 7
|
43
|
+
# Configuration parameters: EnforcedStyle, AllowedPatterns, ForbiddenIdentifiers, ForbiddenPatterns.
|
44
|
+
# SupportedStyles: snake_case, camelCase
|
45
|
+
# ForbiddenIdentifiers: __id__, __send__
|
46
|
+
Naming/MethodName:
|
47
|
+
Exclude:
|
48
|
+
- 'lib/rapitapir/server/rails/controller_base.rb'
|
49
|
+
|
50
|
+
# Offense count: 3
|
51
|
+
# Configuration parameters: NamePrefix, ForbiddenPrefixes, AllowedMethods, MethodDefinitionMacros, UseSorbetSigs.
|
52
|
+
# NamePrefix: is_, has_, have_, does_
|
53
|
+
# ForbiddenPrefixes: is_, has_, have_, does_
|
54
|
+
# AllowedMethods: is_a?
|
55
|
+
# MethodDefinitionMacros: define_method, define_singleton_method
|
56
|
+
Naming/PredicatePrefix:
|
57
|
+
Exclude:
|
58
|
+
- 'spec/**/*'
|
59
|
+
- 'lib/rapitapir/sinatra/oauth2_helpers.rb'
|
60
|
+
|
61
|
+
# Offense count: 3
|
62
|
+
# Configuration parameters: AllowedConstants.
|
63
|
+
Style/Documentation:
|
64
|
+
Exclude:
|
65
|
+
- 'spec/**/*'
|
66
|
+
- 'lib/rapitapir/cli/mcp_export.rb'
|
67
|
+
- 'lib/rapitapir/server/rails_integration.rb'
|
68
|
+
|
69
|
+
# Offense count: 1
|
70
|
+
Style/MissingRespondToMissing:
|
71
|
+
Exclude:
|
72
|
+
- 'lib/rapitapir/server/rails_integration.rb'
|
73
|
+
|
74
|
+
# Offense count: 2
|
75
|
+
Style/OpenStructUse:
|
76
|
+
Exclude:
|
77
|
+
- 'lib/rapitapir/sinatra/oauth2_helpers.rb'
|
78
|
+
|
79
|
+
# Offense count: 1
|
80
|
+
# Configuration parameters: Max.
|
81
|
+
Style/SafeNavigationChainLength:
|
82
|
+
Exclude:
|
83
|
+
- 'lib/rapitapir/ai/mcp.rb'
|