Download the PHP package marfatech/swagger-resolver-bundle without Composer

On this page you can find all versions of the php package marfatech/swagger-resolver-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package swagger-resolver-bundle

Swagger Resolver Bundle

Latest Stable Version Total Downloads

knpbundles.com

Introduction

Bundle provides possibility for validate data according to the OpenApi 3 documentation. You describe your API documentation by OpenApi and provides verification of data for compliance with the described requirements. When documentation has been updated then verification will be updated too, all in one place!

Documentation is cached through the standard Symfony Cache mechanism.

Note: as result bundle returns OptionsResolver object. The object contains the created set of data requirements.

Attention: remember, when you change generated SwaggerResolver object you risk to get divergence with actual documentation.

Integrations

Bundle provides integration with NelmioApiDocBundle, supports configuration loading by swagger-php and also supports loading directly from the json or yaml(yml) configuration file. When used default bundle configuration then swagger documentation will be load in most optimal available way. Loaders priority:

  1. NelmioApiDocBundle - do not require any additional configuration.
  2. swagger-php - Uses openapi_annotation.[area].scan and openapi_annotation.[area].exclude parameters.
  3. json - Uses configuration_file.[area].file parameter.

Installation

Step 1: Download the Bundle

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:

is command requires you to have Composer install globally.

Step 2: Enable the Bundle

Then, enable the bundle by updating your app/AppKernel.php file to enable the bundle:

Configuration

To start using the bundle, a preliminary configuration is required only in case of loading the configuration using swagger-php or a configuration file. Otherwise, no configuration is required.

Schema caching requires component configuration Symfony Cache.

Usage

Step 1: Swagger documentation preparation

OpenApi documentation preparation differ according to used tools of your project.

NelmioApiDocBundle

If your project has NelmioApiDocBundle connected, then no additional configuration is required.

swagger-php

In the absence of NelmioApiDocBundle, the bundle will degrades to the configuration loading by swagger-php annotations. In this case, by default, will be used src/ directory to scan. To optimize scanning process you can describe directories in the configuration:

JSON/YAML or (yml)

If NelmioApiDocBundle is missing, the bundle must be configured to load the json/yaml/yml file.

Custom

If you need to use your own loader, you need to replace the linkin_swagger_resolver.openapi_configuration_factory factory in the symfony container with your own.

Step 2: Data validation

Validation for model

Validation for request

Advanced

Custom validator

Bundle validates the data through the validator system. List of all validators, you can find out by going to the Validator folder. All validators registered as tagging services. To create your own validator it is enough to create class, which implements SwaggerValidatorInterface and then register it under the tag linkin_swagger_resolver.validator.

Custom normalizer

Bundle validates the data through the normalizer system. List of all normalizers, you can find out by going to the Normalizer folder. All normalizers registered as tagging services. To create your own normalizer it is enough to create class, which implements SwaggerNormalizerInterface and then register it under the tag linkin_swagger_resolver.normalizer.

Symfony validator

The bundle provides the ability to use validators for the request body from the Symfony Validator package. To apply validation to a property, you need to add the required constraint to the annotation. Example for NotBlank, Email, NotCompromisedPassword, Length.

Working with enums

The bundle provides the ability to use enumerations for the request body from the marfatech/enumer-bundle package. To apply enums to a property, you need to add a class with a list of possible values to the annotation. The enumer class structure can be found in the documentation for marfatech/enumer-bundle.

License


All versions of swagger-resolver-bundle with dependencies

PHP Build Version
Package Version
Requires php Version ~8.0
ext-json Version *
symfony/cache-contracts Version ^2.5||^3.1
symfony/config Version ~4.4||~5.4||~6.0
symfony/dependency-injection Version ~4.4||~5.4||~6.0
symfony/http-foundation Version ~4.4||~5.4||~6.0
symfony/http-kernel Version ~4.4||~5.4||~6.0
symfony/options-resolver Version ~4.4||~5.4||~6.0
symfony/routing Version ~4.4||~5.4||~6.0
symfony/yaml Version ~4.4||~5.4||~6.0
zircote/swagger-php Version ^4.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package marfatech/swagger-resolver-bundle contains the following files

Loading the files please wait ....