0.0
No commit activity in last 3 years
No release in over 3 years
Rails concern to implement API controllers for Mongoid models using Open API specification.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

 Project Readme

Mongoid OpenAPI

Rails concern to implement CRUD API controllers for Mongoid models using Open API (Swagger) specification.

Swagger generator

Automatic generate powerful representation of your RESTful API.

Setup:

  • Add to you Controller include SwaggerGenerator
  • Add to the end of controller: generate_swagger to generate swagger description of current controller's actions
  • To integrate these description with Swagger UI - Add routes and create Swagger Controller
  • Check Swagger UI at localhost:3000/docs/api/swaggers

Swagger generator has several configurations/options

swagger_options:

  • json_requests: true - make all call in json format
  • scopes: [ { name: :selects, type: :boolean } ] - add sope to swagger
  • resource_class_name: 'UserProfessional' - customize resource/model name. For case, when you have ProfileController, but working/using UserProfessional model here
  • ignore_custom_actions: true - don't generate custom/not CRUD actions
  • collection_name: 'Bootstrap' - For Customize tags and OperationId postfix
  • base_path: '/api/admin' - if you using key :basePath in Swagger Controller write it here
  • relative_path: 'professional/projects' (Will be depricated and using only base_path) - use relative path without basePath for actions.Might be helpfull when key :basePath, '/api' present in Swagger Controller, to prevent generating paths: 'api/api/professional/projects'