Skip to content
This repository has been archived by the owner on Dec 22, 2022. It is now read-only.

Feature/variable endpoints #12

Merged
merged 13 commits into from Feb 3, 2017
Merged

Feature/variable endpoints #12

merged 13 commits into from Feb 3, 2017

Conversation

NRBPerdijk
Copy link
Contributor

Fixes #11

Adds a bunch of endpoints supporting scala rules BusinessServices including:

  • run debug resultsonly for BusinessServices,
  • WARNING, API BREAKING CHANGE: changed the run, debug and resultsonly endpoints for "all" to conform to the new endpoints for BusinessServices
  • added an information/:BusinessService endpoint which provides detailed information for the named BusinessService
  • the businessservices endpoint now provides a map of businessservices, where the key is the endpoint of the service and the value is the endpoint for information on the service

Changed various formatters to account for the presence of specified uitvoer.
Made Converter.contextToJson more robust by adding an "isEmpty" check on the context. An empty context returns an empty JsObject.

NRBPerdijk and others added 13 commits January 17, 2017 15:26
…l to a businessservice is called using its own provided run method, meaning it validates the input.
- run debug resultsonly for BusinessServices,
- WARNING, API BREAKING CHANGE: changed the run, debug and resultsonly endpoints for "all" to conform to the new endpoints for BusinessServices
- added an information/:BusinessService endpoint which provides detailed information for the named BusinessService
- the businessservices endpoint now provides a map of businessservices, where the key is the endpoint of the service and the value is the endpoint for information on the service

Changed various formatters to account for the presence of specified uitvoer.
Made Converter.contextToJson more robust by adding an "isEmpty" check on the context. An empty context returns an empty JsObject.
Simplified the conversion from fact to json so that it now also supports lists. No longer required to mess about with a needlessly complicated map.
Was unable to achieve the same level of elegance for a solution for lists from json to facts in the given time. This will need to be brute-forced through the map-solution until a more clever way is devised, but it's impeded progress for too long.
…r result context contains another fact to context, such as with an ElementBerekening.
…and Writes objects and then choke on the fact that they are implicit... This is not a suitable longterm fix, any object that is defined inside another object will now not be considered for Glossary or JsonConversionMap status, possibly hiding otherwise valid implementations...
private def contextBedragToJsObject(fact: Fact[Any], factValue: Any): JsObject = factValue match {
case bedrag: Bedrag => JsObject(Map(fact.name -> Json.toJson[Bedrag](bedrag)))
case _ => throw new IllegalArgumentException
private def turnFactsIntoJson(factValue: Any): JsValue = //scalastyle:ignore cyclomatic.complexity
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^_^

Copy link
Contributor

@jhkuperus jhkuperus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Things to take from this:

  • weakTypeOf[List[List[List[Bedrag]]]]
  • Error reporting for NumberFormatExceptions
  • Name resolving in JarLoaderService (with $ for objects etc)
  • Investigate turning 'all' endpoint into an (automatic) business service

@jhkuperus jhkuperus merged commit 530b217 into master Feb 3, 2017
@jhkuperus jhkuperus deleted the feature/variableEndpoints branch February 3, 2017 14:16
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants