Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): update dependency openapi_first to v2 #754

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Jan 9, 2025

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
openapi_first (changelog) "~>0.20" -> "~>2.0" age adoption passing confidence

Release Notes

ahx/openapi_first (openapi_first)

v2.1.1

Compare Source

v2.1.0

Compare Source

  • Added OpenapiFirst::Definition#[] to access the raw Hash representation of the OAS document. Example: api['components'].fetch('schemas', 'Stations')

v2.0.4

Compare Source

v2.0.3

Compare Source

  • Fix OpenapiFirst::Test.register https://github.com/ahx/openapi_first/issues/276

  • Request validation middleware now accepts error_response: false do disable rendering a response. This is useful if you just want to collect metrics (via hooks) during a migration phase.

v2.0.2

Compare Source

  • Fix setting custom error response (thanks @​gobijan)

v2.0.0

Compare Source

New Features
  • Test Assertions! 📋 You can now use assert_api_conform for contract testing in your rack-test / Rails integration tests. See Readme for details.

  • New option for Middlewares::ResponseValidation: :raise_error (default: true). If set to false, the middleware will not aise an error if the response is invalid. 🤫

  • Hooks 🪝🪝 (see Readme for details). You can use these to collect metrics, write error logs etc.:

    • after_request_validation
    • after_response_validation
    • after_request_body_property_validation
    • after_request_parameter_property_validation
  • Exceptions such as OpenapiFirst::ResponseInvalidError not respond to #request to get information about the validated request 💁🏻

  • Performance improvements 🚴🏻‍♀️

  • Validation failures returned by ValidatedRequest#error always returns a #message. So you can call my_validated_request.error.message if validated_request.invalid? and always get a human-readable error message. 😴

Breaking Changes
Manual validation

v1.4.3

Compare Source

  • Allow using json_schemer 2...3

v1.4.2

Compare Source

  • Fix Rack 2 compatibility

v1.4.1

Compare Source

  • Fixed: Don't call deprecated methods in middlewares

v1.4.0

Changed

Some redundant methods to validate or inspect requests/responses will be removed in 2.0. So this release deprecates these methods.

  • Deprecate OpenapiFirst::RuntimeRequest#validate, #validate!, #validate_response, #response.
    Use OpenapiFirst.load('openapi.yaml').validate_request(rack_request, raise_error: true/false) instead
  • Deprecate OpenapiFirst::RuntimeResponse#validate.
    Use OpenapiFirst.load('openapi.yaml').validate_response(rack_request, rack_response, raise_error: true/false) instead.

v1.3.6

  • Fixed Rack 2 / Rails 6 compatibility (#​246

v1.3.5

Compare Source

  • Added support for /some/{kebab-cased} path parameters (#​245)

v1.3.4

Compare Source

  • Fixed handling "binary" format in optional multipart file uploads
  • Cache the resolved OAD. This especially makes things run faster in tests.
  • Internally used Operation#query_parameters, Operation#path_parameters etc. now only returns parameters that are defined on the operation level not on the PathItem. Use PathItem#query_parameters to get those.

v1.3.2

Compare Source

Changed
  • The response definition is found even if the status is defined as an Integer instead of a String. This is not provided for in the OAS specification, but is often done this way, because of YAML.
Fixed
  • Reduced initial load time for composed API descriptions #​232
  • Chore: Add Readme back to gem. Add link to docs.

v1.3.1

Compare Source

  • Fixed warning about duplicated constant

v1.3.0

Compare Source

No breaking changes

New features:

  • Added new API: Definition#validate_request, Definition#validate_response, RuntimeRequest#validate_response (see readme) #​222

Fixes:

  • Manual response validation (without the middleware) just works in Rails' request tests now. #​224

v1.2.1

Compare Source

v1.1.1

Compare Source

  • Fix reading response body for example when running Rails (ActionDispatch::Response::RackBody)
  • Add known?, status, body, headers, content_type methods to inspect the parsed response (RuntimeResponse)
  • Add OpenapiFirst::ParseError which is raised by low-level interfaces like request.body if the body could not be parsed.
  • Add "code" field to errors in JSON:API error response

v1.0.0

Compare Source

  • Breaking: The default error uses application/problem+json content-type
  • Breaking: Moved rack middlewares to OpenapiFirst::Middlewares
  • Breaking: Rename OpenapiFirst::ResponseInvalid to OpenapiFirst::ResponseInvalidError
  • Breaking: Remove OpenapiFirst::Router
  • Breaking: Remove env[OpenapiFirst::OPERATION]. Use env[OpenapiFirst::REQUEST] instead.
  • Breaking: Remove env[OpenapiFirst::REQUEST_BODY], env[OpenapiFirst::PARAMS]. Use env[OpenapiFirst::REQUEST].body env[OpenapiFirst::REQUEST].params instead.
  • Add interface to validate requests / responses without middlewares (see "Manual validation" in README)
  • Add OpenapiFirst.configure
  • Add OpenapiFirst.register, OpenapiFirst.plugin
  • Fix response header validation with Rack 3
  • Fixed: Add support for paths like /{a}..{b}

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot force-pushed the renovate/openapi_first-2.x branch from a784af5 to 3977086 Compare January 10, 2025 00:07
@renovate renovate bot force-pushed the renovate/openapi_first-2.x branch from 3977086 to 78485e6 Compare January 10, 2025 00:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants