Skip to content

An implementation of the Star Wars API using Huma

License

Notifications You must be signed in to change notification settings

mtiller/swapi-huma

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Star Wars API with Huma

I wanted to play around with some idea around mixing hypermedia with OpenAPI. So, I wanted to do it with non-work related content, so I decided to implement the Star Wars API but leverage huma.

This is intended as a playground to play around with ideas, so don't take anything here very seriously.

Things of Note

As I already mentioned, I'm using Huma. This handles the OpenAPI generation stuff and also automatically generates schemas for payloads and the URLs they can be found at. So that covers part of what I'd like. But another part is going to be adding hyperlinking data to payloads and for that I'm using my toy project go-claxon which is still very much in a nascent stage.

I'm also leveraging the do package to handle dependency injection. This is very useful for web servers and this repository shows an example of how I've done that using middleware (I may even publish that middleware separately since it seems quite useful). Along the way, I'm also using the dos sibling package lo for all kinds of generics related functionality.

I've included an air configuration as well. Using air allows you to automatically recompile the server while developing. Just run air on the command line (once air is installed) and it takes care of rebuilding automatically.

About

An implementation of the Star Wars API using Huma

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages