VaneStack Logo

vanestack_annotation

Annotations and metadata types for the VaneStack Dart backend framework.

Website ยท Documentation


This package provides the @Route annotation and HttpMethod enum used to define HTTP endpoints in VaneStack. It is a lightweight dependency with zero transitive dependencies.

Usage

import 'package:vanestack_annotation/vanestack_annotation.dart';

@Route(path: '/v1/posts', method: HttpMethod.get)
FutureOr<List<Post>> listPosts(Request request) async {
  // ...
}

@Route(
  path: '/v1/posts/<postId>',
  method: HttpMethod.get,
  requireAuth: true,
)
FutureOr<Post> getPost(Request request, String postId) async {
  // ...
}

API

@Route

Parameter Type Default Description
path String required URL path, supports <param> syntax
method HttpMethod required HTTP method
requireAuth bool false Reject unauthenticated requests
requireSuperUserAuth bool false Require admin privileges
ignoreForClient bool false Exclude from generated client SDK

HttpMethod

get, post, put, delete, patch, head, all

Package Description
vanestack Server framework
vanestack_generator Code generator that reads @Route annotations
vanestack_common Shared models and types
vanestack_client Generated HTTP client SDK