Giter VIP home page Giter VIP logo

openapi2beans's Introduction

openapi2beans

This is a golang tool to convert bean structures found in an openapi.yaml file into java transport beans, for use in the Galasa server.

We do this to make sure that the java code uses the exact same structure as the openapi.yaml declares.

During the build of the framework project, the openapi.yaml file is obtained, and java transport beans rendered.

How to build

Run this script:

./build-locally.sh

How to run

./bin/openapi2beans-${operatingSystem}-${hardwareArchitecture} \
  --api ${filePathToOpenAPI} \
  --outputFolder ${outputFolder}

Where operatingSystem is darwin or linux and hardwareArchitecture is x86_64 or arm64

For example:

./bin/openapi2beans-darwin-arm64 \
  --api myRestApiDefinition.yaml \
  --outputFolder temp/generated

Design

The tool is split into several parts:

  • read the yaml file from disk into memory
  • convert the yaml data into a set of SchemaType in-memory objects
  • for each in-memory SchemaType object...
    • convert the SchemaType in-memory object into a .java file image in memory
    • write the in-memory java file image to disk
  • Report overall status

The overall design can be split into components: shows the overall component code structure

The intermediate in-memory structures look like this: shows the type system used

The generators use templates, and these data structures: shows the data structures used by the file generators

openapi2beans's People

Contributors

wyvinar avatar techcobweb avatar

Watchers

 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.