Skip to content

Conversation

@rafaelcr
Copy link
Collaborator

@rafaelcr rafaelcr commented Oct 3, 2023

Add Fastify helpers that enables us to:

  • Create Fastify servers with CORS and Metrics pre-configured
  • Generate OpenAPI JSON/YAML specs with standard settings

OpenAPI can be generated from APIs like this:

import { generateOpenApiSpec, logger } from '@hirosystems/api-toolkit';
import { Api } from '../src/api/init';
import { OpenApiSchemaOptions } from '../src/api/schemas';

generateOpenApiSpec({
  apiDefinition: Api,
  prefix: '/ordinals/v1',
  swaggerOptions: OpenApiSchemaOptions,
}).catch(err => logger.error(err));

Closes #3

@rafaelcr rafaelcr requested a review from zone117x October 3, 2023 18:37
@andresgalante andresgalante requested review from csgui and removed request for zone117x October 9, 2023 15:37
Copy link

@csgui csgui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

@rafaelcr rafaelcr merged commit f923ce4 into develop Oct 11, 2023
@rafaelcr rafaelcr deleted the feat/docs branch October 11, 2023 16:11
blockstack-devops pushed a commit that referenced this pull request Oct 26, 2023
## [1.2.0](v1.1.0...v1.2.0) (2023-10-26)

### Features

* add fastify helpers ([#9](#9)) ([f923ce4](f923ce4))
* expand tools with Stacks API helpers ([#10](#10)) ([79a08a4](79a08a4))
@blockstack-devops
Copy link

🎉 This PR is included in version 1.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

add documentation generators

4 participants