apinf / platform

Apinf - Open source API management platform with multi proxy and protocol support
https://apinf.com/
European Union Public License 1.1
74 stars 33 forks source link

REST API: Import documentation descriptions from an external file #2908

Closed matleppa closed 7 years ago

matleppa commented 7 years ago

Include documentation from external file

Instead of writing descriptions in same file with program code they can be written in an external file and linked into program code file.

That way the descriptions are included in generated swagger document.

matleppa commented 7 years ago

Comments from @brylie related to review of PR 2876.

// in catalog_api_texts.js (or some other filename)

  export catalogApiDescription = `
  Some markdown descriptive text. **APInf is so cool!**
  `

  export endpointOneDescription = `
  *Markdown* cool!
`

// in catalog_api.js

  import catalogApiDescription from './catalog_api_texts';

  {
    // catalog API swagger definition
   description: catalogApiDescription,
  }
matleppa commented 7 years ago

Numbers of main level (multiline) descriptions (at the moment 2017-09-18):