Coder Social home page Coder Social logo

sql-translator-parser-openapi's Introduction

NAME

SQL::Translator::Parser::OpenAPI - convert OpenAPI schema to SQL::Translator schema

PROJECT STATUS

OS Build status
Linux Build Status

CPAN version Coverage Status

SYNOPSIS

use SQL::Translator;
use SQL::Translator::Parser::OpenAPI;

my $translator = SQL::Translator->new;
$translator->parser("OpenAPI");
$translator->producer("YAML");
$translator->translate($file);

# or...
$ sqlt -f OpenAPI -t MySQL <my-openapi.json >my-mysqlschema.sql

DESCRIPTION

This module implements a SQL::Translator::Parser to convert a JSON::Validator::OpenAPI specification to a SQL::Translator::Schema.

It uses, from the given API spec, the given "definitions" to generate tables in an RDBMS with suitable columns and types.

To try to make the data model represent the "real" data, it applies heuristics:

  • to remove object definitions that only have one property
  • to find object definitions that have all the same properties as another, and remove all but the shortest-named one
  • to remove object definitions whose properties are a strict subset of another

ARGUMENTS

None at present.

PACKAGE FUNCTIONS

parse

Standard as per SQL::Translator::Parser. The input $data is a scalar that can be understood as a JSON::Validator specification.

DEBUGGING

To debug, set environment variable SQLTP_OPENAPI_DEBUG to a true value.

AUTHOR

Ed J, <etj at cpan.org>

LICENSE

Copyright (C) Ed J

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO

SQL::Translator.

SQL::Translator::Parser.

JSON::Validator::OpenAPI.

sql-translator-parser-openapi's People

Contributors

mohawk2 avatar

Watchers

Mohammad Sajid Anwar avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.