Comments (8)
If I subclass the Apipie::ApipiesController in my engine, it starts to work at least, but it doesn't find any controllers with documentation.
from apipie-rails.
You might try setting api_controllers_matcher to match the controllers in your engine. There might be a problem that it will override the settings from the host app, as this case was not considered yet. At least we would know this way is possible, and we can add better support for this.
I will need to do something similar soon, so we can sync our approaches.
from apipie-rails.
So, I may have got it to work.
- include the apipie gem into your engine
- setup the initializer in your engine (using the engine's root/path for controllers)
- add the
apipie
routes call into your application (not the engine)
from apipie-rails.
So, my next problem is that I allow the engine using app to modify fields on some of the core objects, which changes what my API documentation should show (ie: adding a "full_name" parameter to User). Ideally I'd be able to, in the initializer or something do:
Apipie.config do
Core::UserController.modify_docs(:update) do
param :user, Hash do
param :full_name, String, desc: "Optional full name of the user"
end
end
end
I'm looking for maybe where to put it, but I'm in a mazy of twisty passages, all alike.
from apipie-rails.
So, instance_eval
ing a block from with a Hash parameters block does what I was looking for, at least now. It's still icky.
param :user, Hash do
instance_eval(&extra_documentation)
end
from apipie-rails.
I have a mountable engine that is packaged as a gem and then included in my main application; I want the API documentation for the mountable engine to be accessible in the main application. Is this issue now resolved? Are there any step-by-step instructions on working around it? Any guidance will be appreciated.
Thanks.
from apipie-rails.
My 3 steps in #127 (comment) still work for me.
from apipie-rails.
To anyone interested in a solution, following #127 (comment)
The name of my engine is AuthEngine, below follow my config:
# engines/auth_engine/initializers/apipie.rb
Apipie.configure do |config|
config.app_name = "Auth"
config.api_base_url = "/api/auth/"
config.doc_base_url = "/docs/"
config.api_routes = AuthEngine::Engine.routes
config.api_controllers_matcher = "#{AuthEngine::Engine.root}/app/controllers/auth_engine/**/*.rb"
end
In the main Rails App
# config/routes.rb
Rails.application.routes.draw do
apipie
end
from apipie-rails.
Related Issues (20)
- add support to say param1 or param2 required
- Report all missing required parameters instead of just the first HOT 2
- Mark params as deprecated HOT 1
- Enable Style/HashSyntax Ruby 1.9 HOT 2
- Getting So many Warnings while using apipie with Ruby 2.7.7 HOT 15
- Missing translation `apipie.returns`
- How to specify binary-type params HOT 3
- [v1.0] NoMethodError: undefined method `resource_id' for Apipie:Module HOT 2
- Generate multiple swagger-files HOT 7
- Swagger warnings for optional parameters even when using `property` HOT 2
- Swagger generation mixes up controllers with same name: HOT 4
- Apiepie::ParamErrors Inconsistent interface HOT 6
- Swagger JSON cannot parse Array of Hash in params HOT 3
- How do I specify a custom Description, I get "Another API description" HOT 2
- Discrepancy: `params` Defined as Array of Integer in Apipie appears as Array of Strings in Swagger File HOT 4
- Incorrect Representation of Array of Hashes in Swagger Output HOT 3
- How can I define a param group without duplicating what is defined in ActiveRecord model? HOT 1
- How to display an example for a request in Swagger? HOT 2
- Are multiple base url's possible
- "allow_blank" setting is not displayed in api doc HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from apipie-rails.