
Security News
Follow-up and Clarification on Recent Malicious Ruby Gems Campaign
A clarification on our recent research investigating 60 malicious Ruby gems.
YAPI is an excellent tool for managing API documentation, but maintaining consistency between the API documentation and code can be challenging. Instead of relying on manual recognition, let this tool automate the process for you.
This is a tool for checking the consistency and conformity between YAPI API documentation and code, ensuring strong consistency and adherence to standards.
required(:name, :String) # Name
required(:phone, :Integer) # Phone number
required(:height, :Float) # Height
optional(:email, :Email) # Email
optional(:tags, :ArrayJSON) # Tags
json.user do
json.name user.name.to_s
json.phone user.phone.to_i
json.height user.height.to_f
json.email user.email.to_s
json.tags user.tags.to_a
end
gem 'yapi_check'
$ bundle install
require 'yapi_check/tasks'
ENV['YAPI_PROJECT_TOKEN'] = 'THE_TOKEN_FROM_YOUR_YAPI_PROJECT' # YAPI project unique identifier (required), recommended to configure in the project. You can find this token in the YAPI project settings.
ENV['YAPI_PROJECT_DOMAIN'] = 'http://YOUR_YAPI_WEBSITE' # YAPI project domain, recommended to configure on your local machine to avoid changes in ~/.bashrc or ~/.zshrc
ENV['YAPI_API_PREFIX'] = '' # YAPI project API prefix, can be set to '', defaults to /api/v1 if not set
# Full check
$ bundle exec rake yapi:check
# or
$ rails yapi:check
# Check a single interface
$ bundle exec rake yapi:check[/healthy_lives/exit_healthy_life]
# or
$ noglob rails yapi:check[/healthy_lives/exit_healthy_life]
# or
$ rails 'yapi:check[/healthy_lives/exit_healthy_life]'
# Check a single tag
$ bundle exec rake yapi:check[,3.3.0]
# or
$ noglob rails yapi:check[,3.3.0]
# or
$ rails 'yapi:check[,3.3.0]'
This tool is only for Rails projects. Request parameter checks heavily depend on lucky_param, and response parameter checks heavily depend on Jbuilder.
ruby test/yapi_check_test.rb
to run the testsThe gem is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that yapi_check demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.
Security News
ESLint now supports parallel linting with a new --concurrency flag, delivering major speed gains and closing a 10-year-old feature request.
Research
/Security News
A malicious Go module posing as an SSH brute forcer exfiltrates stolen credentials to a Telegram bot controlled by a Russian-speaking threat actor.