Coder Social home page Coder Social logo

schwarmco / manticoresearch-openapi Goto Github PK

View Code? Open in Web Editor NEW

This project forked from manticoresoftware/openapi

0.0 1.0 0.0 2.86 MB

Manticore Search clients generator

License: MIT License

Shell 0.93% JavaScript 6.34% Python 9.13% Perl 0.03% Java 8.10% Scala 0.03% C# 18.54% Elixir 0.63% TypeScript 1.28% Batchfile 0.02% Dockerfile 0.01% Mustache 54.97%

manticoresearch-openapi's Introduction

Manticore Search OpenAPI client generator

This project allows you to automatically generate Manticore Search clients for different languages.

For this purpose, the OpenApi Generator tool is used. More info can be found here.

To generate a client, the OpenApi generator needs a config file describing the structure of API. The file is manticore.yml.
To edit and validate the config, you can use an online editor such as Swagger.

Generated clients

  • Python - it also has a testing suite with incomplete coverage

  • .Net - it also has a testing suite with incomplete coverage

  • Javascript - it also has a testing suite with incomplete coverage

  • Java

  • Elixir

Building

The simplest way to make a build for a specific language, e.g., for Java, is to use our build script:

./build.sh java

You can also build versions for all supported languages at once:

./build.sh all

By default, the latest available version of the OpenApi generator will be used. If you want to apply a specific version, add a corresponding argument to the command call:

build.sh Java v5.0.0   

where v5.0.0 is a tag of the generator's Docker image you need.

The current versions used are 'v6.6.0' for Java and 'v6.1.0.' for the rest of the clients.

Note that you can also use Docker and run the OpenApi generator Docker image directly:

docker pull  openapitools/openapi-generator-cli 

docker run --rm -v ${PWD}:/local openapitools/openapi-generator-cli generate -i /local/manticore.yaml -g java -o /local/out/java

Custom overrides

Using the Docker way for generating clients, you should also apply your custom overrides when it's necessary (for example, to change package names).

By default, the generators use standard package names (like openapi_client). These names need to be changed at build time (since this is not a responsibility of the OpenAPI spec to define how a package for a language must be named).

Package or Project names have their specific variables for each language (there are some general variables for the api/model package, but some generators don't use them!). There are also other variables that may require a custom value to be set for them. To see these, run

docker run --rm -v ${PWD}:/local  -u "$(id -u):$(id -g)" -e JAVA_OPTS="-Dlog.level=warn" openapitools/openapi-generator-cli config-help -g XXX

where XXX is the name of the generator (language).

To add these specific variables, use --additional-properties NAME=VALUE in the docker run command (see build.sh for examples).

Please note that for Java, the library used is okhttp-gson, and some of its templates (like the readme) must be edited in the templates/Java/libraries/okhttp-gson/ folder.

Project folders

Specific client issues

JavaScript

  • delete() is renamed to callDelete because delete() is a reserved method - the only appropriate fix is to rename doc operations to something else (like deleteDocuments())

manticoresearch-openapi's People

Contributors

adriannuta avatar nick-s-2018 avatar marclaporte avatar sanikolaev avatar manticoresearch avatar joshuakosasih avatar vsmid 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.