Skip to content

Releases: cdimascio/express-openapi-validator

express-openapi-validator 1.5.0 available!

18 Aug 13:46
0bb25be
Compare
Choose a tag to compare

Release Notes

  • #32 - Additional properties are incorrectly removed
  • #29 - Tests for Type Coercion

express-openapi-validator 1.4.0 available!

30 Jul 01:19
Compare
Choose a tag to compare

Release Notes

  • (fix) A single item in array type query parameter is not converted to array #27

express-openapi-validator 1.3.0-rc.4 available!

21 Jul 17:52
Compare
Choose a tag to compare

Release notes

  • implements a new request validator
  • removes dependencies on openapi-request-coercer, openapi-request-validator, and openapi-security-handler, and openapi-schema-validator

thanks @sheldhur!

Changes

courtesy @richdouglasevans!

The $ref support is improved

Previously there was an issue with validating $ref-erences. As a workaround until it was fixed we inlined a few of the types — thus incurring some duplication — and it worked fine.

Upgrading to 1.3.0-rc.3 has allowed me to remove the inlining and go back to nice DRY $ref-erences.

Error messages have changed

We have tests that exercise validation: I had to change some of these because the error messages reported by express-openapi-validator changed.

We do some transformation of the validation errors returned by the validator but we do just pass along some of the useful stuff such as the path and the message unchanged.

Finer-grained path reporting

For example, one of our tests sent a product (JSON) in the request body with an (invalid) negative price.

Previously we"d get this response:

errors: [
    {
        "path": "items[0].price",
        "message": "Must be >= 0"
    }
]

And now we get this response: the path now is explicit about the error being in the body of the request.

errors: [
    {
        "path": ".body.items[0].price",
        "message": "Must be >= 0"
    }
]

Unsupported Media type message changed

Unsupported Content-Type text/plain ➡️ unsupported media type text/plain

Richer format support

This snippet from our API spec mentions the format:

quantity:
  type: integer
  format: int32
  minimum: 1

Previously, a test that sent an invalid float value for the quantity would result in this response:

errors: [
    {
        "path": "items[0].quantity",
        "message": "Must be integer"
    }
]

Now we get this response which mentions the format:

errors: [
    {
        "path": ".body.items[0].quantity",
        "message": "Must be integer"
    },
    {
        "path": ".body.items[0].quantity",
        "message": "Must match format \"int32\""
    }
]

express-openapi-validator 1.3.0-rc.3 available!

20 Jul 12:06
Compare
Choose a tag to compare

Release notes

  • implements a new request validator
  • removes dependencies on openapi-request-coercer, openapi-request-validator, and openapi-security-handler

thanks @sheldhur!

Changes

(thanks @richdouglasevans)

The $ref support is improved

Previously there was an issue with validating $ref-erences. As a workaround until it was fixed we inlined a few of the types — thus incurring some duplication — and it worked fine.

Upgrading to 1.3.0-rc.3 has allowed me to remove the inlining and go back to nice DRY $ref-erences.

Error messages have changed

We have tests that exercise validation: I had to change some of these because the error messages reported by express-openapi-validator changed.

We do some transformation of the validation errors returned by the validator but we do just pass along some of the useful stuff such as the path and the message unchanged.

Finer-grained path reporting

For example, one of our tests sent a product (JSON) in the request body with an (invalid) negative price.

Previously we"d get this response:

errors: [
    {
        "path": "items[0].price",
        "message": "Must be >= 0"
    }
]

And now we get this response: the path now is explicit about the error being in the body of the request.

errors: [
    {
        "path": ".body.items[0].price",
        "message": "Must be >= 0"
    }
]

Unsupported Media type message changed

Unsupported Content-Type text/plain ➡️ unsupported media type text/plain

Richer format support

This snippet from our API spec mentions the format:

quantity:
  type: integer
  format: int32
  minimum: 1

Previously, a test that sent an invalid float value for the quantity would result in this response:

errors: [
    {
        "path": "items[0].quantity",
        "message": "Must be integer"
    }
]

Now we get this response which mentions the format:

errors: [
    {
        "path": ".body.items[0].quantity",
        "message": "Must be integer"
    },
    {
        "path": ".body.items[0].quantity",
        "message": "Must match format \"int32\""
    }
]

express-openapi-validator 1.2.2 released!

15 Jul 15:16
Compare
Choose a tag to compare

Release Notes

  • update lodash

express-openapi-validator 1.2.1 released!

08 Jul 21:48
Compare
Choose a tag to compare

Release Notes

  • (fix) #10 performance - cache validator and coercer per endpoint

express-openapi-validator 1.2.0 released!

07 Jul 19:26
Compare
Choose a tag to compare

Release Notes

  • implmented #9 pass in open api spec as a plain js object

v1.1.0 released

04 Jul 02:56
Compare
Choose a tag to compare

release notes

  • (fix) #8 Parameters using $ref are not validated

express-openapi-validator v0.53.3 released!

26 May 17:30
5681e1f
Compare
Choose a tag to compare

Release Notes

  • add multipart / file upload support
  • fixes: Content-Type: multipart/form-data with the boundary #7

express-openapi-validator v0.53.2 released!

24 May 17:43
Compare
Choose a tag to compare

Release Notes

  • add multipart / file upload support
  • fixes: Content-Type: multipart/form-data with the boundary #7