Commit Graph

7 Commits

Author SHA1 Message Date
Mark Perryman
e6ceb1fc0a Generate examples with jsf (#1891)
Fixes https://github.com/spec-first/connexion/issues/1719 .

Builds on work of https://github.com/spec-first/connexion/pull/1718,
pulling in external library to provide the fake data from JSON schema.

Changes proposed in this pull request:

* Use JSF library to generate sample data for mocking APIs without
examples.
* Add this as a new extra dependency "mock"

See discussion on https://github.com/spec-first/connexion/pull/1870

---------

Co-authored-by: Robbe Sneyders <robbe.sneyders@gmail.com>
2024-03-20 22:27:14 +01:00
Robbe Sneyders
4f6ddfb0a0 Add jsonifier as argument to app / api (#1656)
This PR adds a `jsonifier` argument to the app and api to align it with
other customization options. We also no longer pass it via the operation
object, which brings us closer to operations as data class only.
2023-03-02 22:00:47 +01:00
Robbe Sneyders
600ed4ed94 Format files with black 2022-06-25 23:50:52 +02:00
Robbe Sneyders
e0183d3485 Clean up operation classes (#1535) 2022-05-13 15:04:51 +02:00
Alberto Massidda
3446508c3d fixed mocks not honouring OpeanAPI 3 examples standard (printing "value" key in output examples) (#1091) 2019-12-03 22:05:50 +01:00
Alberto Massidda
6dc2b7fada Fixed mocking function not working with examples under numeric status codes (e.g., 200) , due to status code string being casted as integer and not raising a ValueError. (#1088)
Included tests that break without the patch (it was testing for 'default' only, but not for numeric codes like '200')
2019-12-03 00:06:50 +01:00
João Santos
44ea9336fe Connexion 2.0 (#619)
- App and Api options must be provided through the "options" argument (``old_style_options`` have been removed).
- You must specify a form content-type in 'consumes' in order to consume form data.
- The `Operation` interface has been formalized in the `AbstractOperation` class.
- The `Operation` class has been renamed to `Swagger2Operation`.
- Array parameter deserialization now follows the Swagger 2.0 spec more closely.
  In situations when a query parameter is passed multiple times, and the collectionFormat is either csv or pipes, the right-most value will be used.
  For example, `?q=1,2,3&q=4,5,6` will result in `q = [4, 5, 6]`.
  The old behavior is available by setting the collectionFormat to `multi`, or by importing `decorators.uri_parsing.AlwaysMultiURIParser` and passing `parser_class=AlwaysMultiURIParser` to your Api.
- The spec validator library has changed from `swagger-spec-validator` to `openapi-spec-validator`.
- Errors that previously raised `SwaggerValidationError` now raise the `InvalidSpecification` exception.
  All spec validation errors should be wrapped with `InvalidSpecification`.
- Support for nullable/x-nullable, readOnly and writeOnly/x-writeOnly has been added to the standard json schema validator.
- Custom validators can now be specified on api level (instead of app level).
- Added support for basic authentication and apikey authentication
- If unsupported security requirements are defined or ``x-tokenInfoFunc``/``x-tokenInfoUrl`` is missing, connexion now denies requests instead of allowing access without security-check.
- Accessing ``connexion.request.user`` / ``flask.request.user`` is no longer supported, use ``connexion.context['user']`` instead
2018-11-05 14:50:42 +01:00