Coder Social home page Coder Social logo

metamug / r2 Goto Github PK

View Code? Open in Web Editor NEW
10.0 3.0 3.0 98.68 MB

R2 is your REST API Server that can connect with your database and other APIs using simple resource configurations

Java 79.40% XSLT 2.98% HTML 8.52% Batchfile 3.75% Shell 4.17% Groovy 1.18%
api-generator openapi openapi3 rest rest-api swagger

r2's People

Contributors

ancode4 avatar archies-coder avatar d3ep4k avatar dependabot[bot] avatar harshalsgore avatar kaisteel avatar metamug2 avatar richard937 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

r2's Issues

Xrequest url print issue

Xrequest print error:
Input XML

 <Sql id="testres" ref="testresource" datasource="mysqltest" type="query" output="true"></Sql>
   <XRequest id="members" method="GET" output="true" 
   url="https://us20.api.mailchimp.com/3.0/lists/bf104d20b3/members/">
   <Header name="Authorization" value="apikey 261ced5c9403b344aa6eaf480d514853-us20"/>
   </XRequest>
 </Sql>

Erroneous jsp output:

<sql:query var="testres" dataSource="mysqltest">select * from movie
url="https://us20.api.mailchimp.com/3.0/lists/bf104d20b3/members/" value="apikey 261ced5c9403b344aa6eaf480d514853-us20"</sql:query>

<c:set target="${output}" property="testres" value="${pageScope['testres']}"/>

<m:xrequest var="members" method="GET" output="true">
<m:header name="Authorization"/>
</m:xrequest>

Add output to text element`

The below generate

<Text id="loc4">$[loc2]</Text>
<c:set var="loc4" scope="page" value="${loc2.rows[0].null}"/>
<c:set target="${output}" property="loc4" value="${pageScope['loc4']}"/>

Open API spec "/" issue

The openapi json shows an extra "/" in the path which causes the swagger editor to break.

Stacktrace when sending Content-type application json GET request

It is incorrect to send application/json Content-TYpe when the request method is GET, still the server should give valid json error instead of throwing this error. Or it should handle the error.

com.eclipsesource.json.ParseException: Unexpected end of input at 1:1
com.eclipsesource.json.JsonParser.error(JsonParser.java:490)
com.eclipsesource.json.JsonParser.expected(JsonParser.java:484)
com.eclipsesource.json.JsonParser.readValue(JsonParser.java:193)
com.eclipsesource.json.JsonParser.parse(JsonParser.java:152)
com.eclipsesource.json.JsonParser.parse(JsonParser.java:91)
com.eclipsesource.json.Json.parse(Json.java:295)
com.github.wnameless.json.flattener.JsonFlattener.(JsonFlattener.java:122)
com.github.wnameless.json.flattener.JsonFlattener.flattenAsMap(JsonFlattener.java:99)
com.metamug.mason.entity.request.JsonStrategy.(JsonStrategy.java:39)
com.metamug.mason.entity.request.RequestAdapter.create(RequestAdapter.java:52)
com.metamug.mason.Router.processRequest(Router.java:636)
com.metamug.mason.Router.doFilter(Router.java:606)
com.metamug.api.mason.filters.AnalyticFilter.doFilter(AnalyticFilter.java:251)
org.apache.catalina.filters.CorsFilter.handleNonCORS(CorsFilter.java:352)
org.apache.catalina.filters.CorsFilter.doFilter(CorsFilter.java:171)
org.apache.catalina.filters.ExpiresFilter.doFilter(ExpiresFilter.java:1226)

Consistent key name for conditional queries.

Following tags will either loc2 or loc3.

<Sql id="loc2" limit="limit" when="empty $tz">
	select name, lat, lon, timezone as 'tz' from city where name like '$q%' and timezone = 'Asia/Kolkata'
</Sql>

<Sql id="loc3" limit="limit"  when="not empty $tz">
	select name, lat, lon, timezone as 'tz' from city where name like '$q%' and timezone = $tz
</Sql>

Unable to use $variable in Xrequest url

<XRequest id="issue" method="GET" output="true" url="https://metamug.atlassian.net/rest/api/3/issue/$issueId">

Does not convert the $issueId variable into the respective jsp

Extra param tag generated when using limit attribute

Extra tag generated with default value -1. This can be caused due to limit attribute

<Param name="l" type="number" required="true" min="5" max="20" value="5"/>
<Sql id="loc" limit="l" >
    select name, lat, lon from city where name like '$q%'
</Sql>
<m:param name="l" type="NUMBER" value="${mtgReq.params['l']}" max="20.0" min="5.0" defaultValue="5" isRequired="true"/>
<m:param name="l" value="${mtgReq.params['l']}" type="number" defaultValue="-1"/>
<sql:query var="loc" dataSource="${datasource}" maxRows="${mtgReq.params['l']}">select name, lat, lon from city where name like CONCAT(? ,'%')
	<sql:param value="${mtgReq.params['q']}"/>
</sql:query>

Tagging Support in Resource and Request

Swagger specs add tags to request level. So we need tag attribute on request tag or we can add description inside
the Request tag to support request level tags

https://swagger.io/docs/specification/grouping-operations-with-tags/

<Resource>
  <Desc>
    This resource is for customer operations
    <Tag name="customer-operations" color="#CAFE00"/>
  </Desc>
  <Request>
    <Desc>
      This request performs operations for the customer.
       <Tag name="customer-query" color="#00CAFE"/>
    </Desc>
  </Request>
</Resource>

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.