Skip to content

failer-dev/onedef

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

onedef

One definition. HTTP server, Dart SDK and TypeScript SDK — all at once.

Go 1.25+

The Solution

In onedef, the struct is the API contract and spec.

type GetUserAPI struct {
    onedef.GET `path:"/users/{id}"`
    Request    struct{ ID string }
    Response   User
}

func (h *GetUserAPI) Handle(ctx context.Context) error {
    h.Response = db.FindUser(h.Request.ID)
    return nil
}

This single struct gives you:

  • GET /users/{id} — registered, path param parsed, response serialized
  • Dart SDK — curl localhost:8080/onedef/sdk/dart
  • TypeScript SDK — curl localhost:8080/onedef/sdk/ts (TODO)

Change the struct. Everything updates. Synchronization cannot break — structurally.

Why onedef?

TL;DR: The paradigm shift in the LLM era isn't using LLM as a tool — it's making your project a tool for LLM.

Read more in WHY_ONEDEF.md.

About

LLM-first API Framework

Resources

License

Stars

Watchers

Forks

Packages