nestia icon indicating copy to clipboard operation
nestia copied to clipboard

Configuration for Swagger documentation

Open AtlasRW opened this issue 3 years ago • 1 comments

Feature Request

Hi guys, maybe that option already exists, sorry if that is the case but I couldn't find it.

One option to help generate better documentation when outputting Swagger specs would be to define the API's servers, tags, or title, in order to customise that part of the output :

{
  "openapi": "3.0.1",
  "servers": [
    {
      "url": "https://github.com/samchon/nestia", // URL
      "description": "insert your server url" // Description
    }
  ],
  "info": {
    "version": "0.1.0", // Version
    "title": "Generated by nestia - https://github.com/samchon/nestia" // Title
  },
  "paths": {

The best way to enable this feature would probably be to provide parameters in the swagger part of the nestia.config.ts like this :

swagger: {
        output: './swagger.json',
        version: '0.1.0',
        title: 'Generated by nestia - https://github.com/samchon/nestia',
        servers: [
            {
                description: 'insert your server url',
                url: 'https://github.com/samchon/nestia',    
            }
        ]
    }

And maybe one last killer feature would be to get the project's version into the project's package.json, but that may be overkill.

AtlasRW avatar Oct 11 '22 18:10 AtlasRW

Good idea, you're right. I will generate the swagger documents following the package.json's version.

samchon avatar Oct 13 '22 17:10 samchon