OpenAPI or swagger.json auto discovery

前端 未结 3 1636
闹比i
闹比i 2021-01-13 07:57

Is there any spec or convention on URL where one should place swagger.json (or whatever name it is agreed) so that public API of my site can be automatically di

3条回答
  •  半阙折子戏
    2021-01-13 08:13

    How about serving the Swagger JSON in an HTTP response body, in response to an OPTIONS request for the URL / ?

    This is specifically permitted by the relevant RFC.

    Further, consider implementing HATEOAS, as strongly advocated by Roy Fielding.

提交回复
热议问题