Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Awkward "skip API call" implementation #1801

Open
bbenligiray opened this issue Jun 6, 2023 · 1 comment
Open

Awkward "skip API call" implementation #1801

bbenligiray opened this issue Jun 6, 2023 · 1 comment

Comments

@bbenligiray
Copy link
Member

While declaring an endpoint, one can omit operation, which means the API call is to be skipped, and the fulfillment will depend on pre/post processing https://docs.api3.org/reference/ois/latest/processing.html#skip-the-api-call This works fine, but there are some issues with the implementation

if (!endpoint.operation && isEmpty(endpoint.fixedOperationParameters)) {

  • The implementation require operation to not be defined and fixedOperationParameters to be empty to skip the call. Instead, the implementation should only require operation to not be defined, and the fact that fixedOperationParameters is empty should be validated.
  • The implementation throws if operation is not defined and both pre-processing and post-processing are empty. These should be validated instead of checking at runtime.
  • When an endpoint doesn't define an operation, none of its parameters should have an operationParameter defined. It's currently not possible to not define an operationParameter for an endpoint parameter, so the only way to use this feature is to map these endpoints to dummy operation parameters. This issue is not specific to skipping API calls and is tracked in Allow endpoint parameters to not be mapped to operation parameters #1800
@bbenligiray
Copy link
Member Author

Is this still relevant @bdrhn9 ? (asking you because of the Nodary RNG OIS)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant