GithubHelp home page GithubHelp logo

roskenet / json-fields Goto Github PK

View Code? Open in Web Editor NEW

This project forked from marembo2008/json-fields

0.0 3.0 0.0 106 KB

A Framework for limiting fields of JSON objects exposed by Rest APIs

License: Apache License 2.0

ANTLR 0.69% Java 97.59% Groovy 1.72%

json-fields's Introduction

JSON fields

This is a proposed standard extension to Rest APIs that return JSON.

If and when the request contains a query parameter named "fields" with a blacklist or whitelist of the form

(field1!(subfield1, subfield2),field2(subfield3, subfield4)

Then the returned JSON would contain only the fields "field1" and "field2", which in turn would contain the nested properties "field2.subfield3", "field2.subfield4", and all fields from "field1" except "subfield1" and "subfield2".

The "grammar" sub-project contains the underlying ANTLR4 grammar, other projects may provide implementations of the grammar for different languages and environments.

You can find the grammar at grammar/src/main/antlr4/JsonFields.g4

Also check out this Unit Test Class for valid field expressions according to this grammar: JsonFieldsGrammarSyntaxTest.java

json-fields's People

Contributors

mostlymagic avatar

Watchers

James Cloos avatar Felix Roske 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.