Skip to content

Conversation

sun-yryr
Copy link
Contributor

This PR enables the generation of server configurations that conform to the openapi specification.
Here is the reference I used.

Example:

config/openapi.php
~~~
'servers' => [
    [
        'url' => env('APP_URL'),
        'description' => null,
        'variables' => [
            'variable_name_A' => [
                'default' => 'default_A',
                'description' => 'sample',
                'enum' => ['A', 'B'],
            ],
            'variable_name_B' => [
                'default' => 'default_B',
                'description' => 'sample',
            ],
        ],
    ],
],
~~~

output json

~~~
"servers": [
    {
        "url": "http://localhost",
        "description": "",
        "variables": {
            "variable_name_A": {
                "description": "sample",
                "default": "default_A",
                "enum": [
                    "A",
                    "B"
                ]
            },
            "variable_name_B": {
                "description": "sample",
                "default": "default_B"
            }
        }
    }
],
~~~

@sun-yryr sun-yryr force-pushed the feature/generate-server branch from bc7811b to c8328e7 Compare April 30, 2021 08:56
@sun-yryr sun-yryr force-pushed the feature/generate-server branch from c8328e7 to a15a2de Compare April 30, 2021 08:57
Copy link

@borisson borisson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if it is appropriate for me to review this, but I found some things that could be improved.

@vyuldashev vyuldashev merged commit de5f355 into vyuldashev:master May 7, 2021
@vyuldashev
Copy link
Owner

Released under v1.3.0. Thanks for the contribution!

@sun-yryr sun-yryr deleted the feature/generate-server branch May 7, 2021 11:04
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.

3 participants