Skip to content

šŸ™ A fully-featured and well-defined generic API client to interact with OpenapiĀ®

License

Notifications You must be signed in to change notification settings

openapi/openapi-generic-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Ā 

History

14 Commits
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 

Repository files navigation

šŸ™ OpenapiĀ® Generic SDK

āš ļø This is a Reference Implementation - pseudocode and reference materials only, not a functional SDK. For working SDKs, see language-specific SDKs below.

Languages
Java Ā  Kotlin Ā  JavaScript Ā  TypeScript Ā  Python Ā  PHP Ā  Go Ā  Rust
C# / .NET Ā  Ruby Ā  Swift Ā  Objective-C Ā  Shell / Bash Ā  CLI Tools

This repository contains a language-agnostic blueprint for implementing OpenapiĀ® client libraries. Also contains standardized patterns, test specifications, and reference implementation.

Project Structure

src/                  # Pseudocode specifications (oauth_client, api_client, types)
tests/                # Test case specifications
examples/             # Usage examples
docs/                 # Implementation guide
reference/            # Rust reference implementation

Core Components

  • OauthClient - Token management with Basic auth (username:api_key)
  • ApiClient - HTTP client with Bearer token auth
  • Types - Standardized data structures and error handling

Quick Example

// 1. Generate a token
oauth = new OauthClient("username", "api_key", test=true)
token_response = oauth.create_token(["GET:test.imprese.openapi.it/advance"], 3600)
access_token = parse_json(token_response)["token"]

// 2. Make API calls
client = new ApiClient(access_token)
response = client.get("https://test.imprese.openapi.it/advance", {"denominazione": "altravia"})

For SDK Developers

  1. Study src/*.pseudo files as reference
  2. Implement OauthClient, ApiClient, and type definitions
  3. Follow the test cases in tests/
  4. See docs/implementation-guide.md for detailed guidance

License

MIT - See LICENSE for details.