Comments (4)
Yeah, handling versions here is tricky.
There are a couple reasons we chose to fix each release to a specific TRAPI version.
- This keeps the package as lightweight as possible. We don't have to include every historical TRAPI spec or GET them at run time (reasoner-validator works without an internet connection).
- The TRAPI components sometimes actually change names between versions. Since our functions are named after the TRAPI components, it seems strange to allow specification of the version with each function call.
Now, if we were to restructure our API a bit, these objections could carry less weight. Something like jsonschema's IValidator interface might would be better.
from reasoner-validator.
Thanks Patrick for the feedback.
Regarding item 1, the package you build is already super duper light weight, and you've released only a few versions which mainly only change the .yml file schema. Since your function signatures are all dynamic anyways, then it seems feasible to just accept schema_version="something" as an argument to the validation. A few .yaml files that are 33KB is nothing to my build. Even if you had 100 of them.
Regarding item 2, same point about dynamic function signatures. Our intellisense can't pick it up, anyway. Seems like this would work if the validation object and the schema are both passed, then it would solve both of those problems.
For example, something like:
reasoner_validator.validate_Response(myResponseObject)
would become
reasoner_validator.validate(validationObject=myResponseObject, validationType="Response", validationSchema="1.0.2")
Right now, my intellisense doesn't help me at all as you can see here:
from reasoner-validator.
All good points. And avoiding hitting the internet is kinda silly for 1) any PyPI package and 2) especially one meant for validating REST API payloads.
It's a bummer that intellisense doesn't work. What does work with the dynamic function generation is the sphinx autodoc. I was having a bit of fun there, but a well-documented bad API is still a bad API.
So we're talking about a substantial change, but it should make the package more usable and actually easier to maintain in the future. I'll make a 2.0 branch.
from reasoner-validator.
For our stack, we are versioning our api through the router like /v0.9/ /v1.0/ and /v1.1/.
So its all the same source code, infrastructure, cicd, container, etc. So we cannot install 2 versions of the same package (your package).
So we have resorted to copy your source code for reasoner_validator 1.0 and pasting it in statically, and then install from github for the latest 1.1.
from reasoner-validator.
Related Issues (20)
- If a TRAPI Attribute is received with "value: None" (or null) this should trigger a validation error HOT 14
- Detect 'dangling nodes/edges' by iterating through node <-> edge mappings) HOT 6
- Issue with dependencies HOT 6
- Deleting node ids? HOT 1
- Allow the user to specify a local schema HOT 3
- Should we distinguish validation between critical versus simple errors HOT 4
- Extend ARS script HOT 1
- Why is EDAM-DATA: unknown to Biolink? HOT 6
- Can we report the source? HOT 11
- Capture and use the 1.4.0 TRAPI Response biolink_version and (TRAPI) schema_version declarations HOT 5
- Can abstract class category error be made into a warning instead? HOT 21
- Why global? HOT 5
- Agent type and knowledge level? HOT 5
- Validation of edge qualifier values is incomplete HOT 3
- Abstract/mixin categories should be totally ignored in lists of node categories that include a concrete category HOT 1
- Fix Qualifier value validation (driven by specific use case) HOT 1
- GitHub API limits causes Reasoner Validator to occasionally fail upon import HOT 3
- Can some clever caching of schemas speed things up?
- Reasoner Validator is altering the dictionary objects upon validation HOT 1
- Add 'biolink:interacts_with' as an 'exceptional' mixin predicate to be warning not errors HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from reasoner-validator.