You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now spec is verbose and we have a lot of repeats for endpoints
Proposed Feature
The idea is to create a new spec lang on top of the current lang, the same way as TS for JS, but for spec.
Here is an example of a new spec language
api_collections:
- enabled: truecollection_data:
api_interface: "rest"type: "GET"# default settings for each endpoint api_default:
block_parsing:
parser_arg: ["latest"]purser_func: "DEFAULT"computute_unit: 10enabled: truecategory:
deterministic: truelocal: falsesubscription: falsestateful: falseextra_compute_units: 0apis:
# here is an example of endpoints with default params
- name: ['/example/example/v1beta1/params','/example/example/v1beta1/params','/example/example/v1beta1/params',]# here is the example of the batch of endpoints with overridden params
- name: ["/example/example/v1beta1/params","/example/example/v1beta1/params","/example/example/v1beta1/params",]cotegory:
deterministic: true# override single endpoint settings
- name: '/example/example/v1beta1/params'extra_compute_units: 5
This YAML example will be transpile to regular JSON spec.
The compiler will convert bidirectional
json -> yaml
yaml -> json
This approach will increase the readability of spec and maintainability. We don't need to modify existing spec logic on-chain, because translation will be done off-chain.
The text was updated successfully, but these errors were encountered:
RuslanGlaznyov
changed the title
[Feature]: New SPEC lanuage to make it less verbose
[Feature]: New SPEC Language to Make It Less verbose. Increase readability and maintainability
Jul 9, 2024
RuslanGlaznyov
changed the title
[Feature]: New SPEC Language to Make It Less verbose. Increase readability and maintainability
[Feature]: New SPEC language to make It less verbose. Increase readability and maintainability
Jul 9, 2024
thanks @RuslanGlaznyov i love this initiative, improving spec stack allows more champions and easier onboarding which is one of our goals
will definitely revisit this post launch
Summary
We have verbose API descriptions in the SPEC, which are challenging to write and review.
For example, in lava spec, this setting repeats for all endpoints:
https://github.com/lavanet/lava/blob/main/cookbook/specs/lava.json#L36
The same thing for verifications and extensions
https://github.com/lavanet/lava/blob/main/cookbook/specs/lava.json#L1247
https://github.com/lavanet/lava/blob/main/cookbook/specs/lava.json#L2463
https://github.com/lavanet/lava/blob/main/cookbook/specs/lava.json#L2507
Problem Definition
Now spec is verbose and we have a lot of repeats for endpoints
Proposed Feature
The idea is to create a new spec lang on top of the current lang, the same way as TS for JS, but for spec.
Here is an example of a new spec language
This YAML example will be transpile to regular JSON spec.
The compiler will convert bidirectional
json -> yaml
yaml -> json
This approach will increase the readability of spec and maintainability. We don't need to modify existing spec logic on-chain, because translation will be done off-chain.
The text was updated successfully, but these errors were encountered: