New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@goast/core

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@goast/core

A tool designed to transform OpenAPI specifications into various forms with flexibility and extensibility at its core.

  • 0.4.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
445
decreased by-28.57%
Maintainers
1
Weekly downloads
 
Created
Source

gOAst (@goast/core)

@goast/core NPM Version @goast/core JSR Version

gOAst stands for generative Open API specification transformer, a tool designed to transform OpenAPI specifications into various forms with flexibility and extensibility at its core.

For more Information, please visit the gOAst GitHub Repository.

Purpose 👍

The @goast/core package provides:

  • entry points for using the gOAst library
  • base classes for creating custom generators
  • utilities for parsing and transforming OpenAPI specifications

Usage Example 🚀

import { OpenApiGenerator } from '@goast/core';

class MyGenerator implements OpenApiGenerationProvider {
  generate(
    context: OpenApiGeneratorContext<OpenApiGeneratorInput>,
    config?: Partial<Readonly<Record<string, unknown>>>,
  ): Record<string, unknown> {
    // Do something
    return {};
  }
}

async function main() {
  const generator = new OpenApiGenerator()
    // Add a generator using a class
    .useType(MyGenerator)
    // Add a generator using a function
    .useFn((ctx, cfg) => {
      // Do the generation
      return {}; // Return information about the generated files so it can be used by other generators
    })
    // Add a generator using an object implementing `OpenApiGenerationProvider`
    .useValue({ generate: (ctx, cfg) => ({}) });

  // Generate for one of more OpenAPI specification files
  await generator.parseAndGenerate('path/to/openapi.json', 'path/to/another/openapi.yaml');

  // Alternatively, you can generate output for all specifications in a directory.
  // By default, it will only consider files within the directory (non-recursively) with the extensions: .json, .yaml, .yml.
  await generator.parseAndGenerateFromDir('path/to/openapi/specs');
}

main();

Available Generator Packages 📚

@goast/typescript NPM Version @goast/kotlin NPM Version
@goast/typescript JSR Version @goast/kotlin JSR Version

API Documentation 📖

The API documentation can be found here.

FAQs

Package last updated on 22 Jan 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc