API Documentation (Swagger/OpenAPI) for Web Application

Our company is engaged in the development, support and maintenance of sites of any complexity. From simple one-page sites to large-scale cluster systems built on micro services. Experience of developers is confirmed by certificates from vendors.
Development and maintenance of all types of websites:
Informational websites or web applications
Business card websites, landing pages, corporate websites, online catalogs, quizzes, promo websites, blogs, news resources, informational portals, forums, aggregators
E-commerce websites or web applications
Online stores, B2B portals, marketplaces, online exchanges, cashback websites, exchanges, dropshipping platforms, product parsers
Business process management web applications
CRM systems, ERP systems, corporate portals, production management systems, information parsers
Electronic service websites or web applications
Classified ads platforms, online schools, online cinemas, website builders, portals for electronic services, video hosting platforms, thematic portals

These are just some of the technical types of websites we work with, and each of them can have its own specific features and functionality, as well as be customized to meet the specific needs and goals of the client.

Our competencies:
Development stages
Latest works
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1161
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1041
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    822
  • image_crm_chasseurs_493_0.webp
    CRM development for Chasseurs
    847
  • image_website-sbh_0.png
    Website development for SBH Partners
    999
  • image_website-_0.png
    Website development for Red Pear
    451

Documenting API (Swagger/OpenAPI) for Web Application

OpenAPI (formerly Swagger)—a standard for describing REST APIs in YAML or JSON format. Documentation in OpenAPI format allows automatic generation of interactive UI (Swagger UI, Redoc), client SDKs, and server stubs.

OpenAPI 3.1 Structure

openapi: 3.1.0
info:
  title: Articles API
  version: 1.0.0
  description: |
    REST API for managing articles.
    ## Authentication
    Bearer token in `Authorization: Bearer <token>` header

servers:
  - url: https://api.example.com/v1
    description: Production
  - url: http://localhost:3000/v1
    description: Development

paths:
  /articles:
    get:
      tags: [Articles]
      summary: List of articles
      operationId: listArticles
      parameters:
        - name: page
          in: query
          schema: { type: integer, default: 1, minimum: 1 }
        - name: limit
          in: query
          schema: { type: integer, default: 20, maximum: 100 }
        - name: status
          in: query
          schema: { type: string, enum: [draft, published, archived] }
      responses:
        '200':
          description: List of articles
          content:
            application/json:
              schema: { $ref: '#/components/schemas/ArticleList' }
        '401':
          $ref: '#/components/responses/Unauthorized'
      security:
        - bearerAuth: []

components:
  schemas:
    Article:
      type: object
      required: [id, title, status, createdAt]
      properties:
        id: { type: string, format: uuid }
        title: { type: string, maxLength: 200 }
        status: { type: string, enum: [draft, published, archived] }
        createdAt: { type: string, format: date-time }

  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

  responses:
    Unauthorized:
      description: Not authorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'

Code-First vs Design-First

Design-first: write OpenAPI YAML first, then implement. Ensures API-first approach, contract before development.

Code-first: annotations/decorators in code generate OpenAPI. More convenient for existing projects.

Laravel (PHP)—code-first via dedoc/scramble:

// Auto-generates OpenAPI from routes and PHPDoc
composer require dedoc/scramble

// In AppServiceProvider
Scramble::configure()
    ->withDocumentTransformer(function (OpenApi $openApi) {
        $openApi->secure(SecurityScheme::http('bearer'));
    });

Node.js—via tsoa or Fastify:

// Fastify + @fastify/swagger
fastify.register(fastifySwagger, {
  openapi: { info: { title: 'API', version: '1.0' } }
});

Tools and Viewers

  • Swagger UI—interactive documentation, try-it-out requests
  • Redoc—clean reference documentation
  • Stoplight—visual API design editor
  • Postman—import OpenAPI specs, test APIs

Timelines

Design-first OpenAPI documentation: 2–3 days. Code-first setup with auto-generation: 1–2 days. Full documentation with examples, authentication flows: 3–5 days.