OpenAPITools / OpenAPITools/openapi-generator

[REQ] Generation of plain, dependency-free C code for microcontrollers

Open
#2,718 15 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Client: C Enhancement: Feature
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

I'm using the openapi-generator extensively, but have so far been held back by the inability to generate dependency-free C-code that an be loaded onto an ESP-32 or similar, large microcontroller. Every server generator pulls in so many dependencies that the microcontroller's memory would filled up by the dependencies' code alone, if it were even possible to compile these dependencies for the target CPU at all. In order to open up the IoT to openapi, a simple C server stub would be a good solution.

It would, to be universal, probably need to work like this:

int default_api_process(const char *method, const char *url, const char *inputBuffer, int inputSize, char *outputBuffer, int *outputSize);

where the return value would be the HTTP status to send, the outputBuffer would be filled with the fully formatted (with all headers) html document, the inputBuffer represents the request body and the URL is the complete URL to process.

That would be useful on ESP8266, ESP-32 and other wifi-enabled IoT CPUs.

Using C++ would be possible as well, however, these small CPUs have no heap and therefore no operator new.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files, tests, or generator entry points. Review the existing server-generator architecture and the proposed default_api_process signature first; done means a dependency-free C server stub can be generated for microcontrollers such as ESP8266 and ESP-32 without heap allocation.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
api, embedded-iot
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.