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

enforce pagination to avoid resource consumption #145

Open
ioggstream opened this issue Jan 12, 2021 · 7 comments
Open

enforce pagination to avoid resource consumption #145

ioggstream opened this issue Jan 12, 2021 · 7 comments
Labels
Hacktoberfest rules Rules for interoperability and security

Comments

@ioggstream
Copy link
Collaborator

ioggstream commented Jan 12, 2021

I expect

La paginazione DEVE essere implementata tramite i parametri:
cursor, limit, offset, sort

La ricerca, il filtering e l’embedding dei parametri DEVE essere implementata tramite i parametri:
q, fields, embed

Note

How to detect if a request requires pagination?
Can we just check if it has parameters?
Whether the response has an array field?

@ioggstream ioggstream added the rules Rules for interoperability and security label Jan 15, 2021
@codedust
Copy link
Contributor

We built a rule for exactly this purpose:

@ioggstream
Copy link
Collaborator Author

Thanks! I'll check it. OT: how are you going to manage the switch to Spectral 6? Some rules stopped working...

@ioggstream
Copy link
Collaborator Author

ioggstream commented Nov 24, 2021

Moreover w are now supporting versioned rulesets. we are renaming rules because Spectral 6 doesn't allow custom properties in rules: we had then to replace tags with some other mechanism.

All security rules will start with sec-
Some of them are now mandatory so they will be moved under rules/
whereas security/ will contain optional security rules.

We have to identify a prefix for Mandatory Italian rules which are stricter than best practices, eg ita- Otherwise specific keywords can be in the description... We've to think about it.

To use versioned ruleset, see https://github.com/italia/api-oas-checker/blob/master/README.en.md#ci-mode-versioned-rulesets @codedust

If you need a specific untagged version from the past, just let me know the date and I'll create the missing tag.

@codedust
Copy link
Contributor

We did not look into switching to Spectral 6 yet, tbh. For now, we're stuck with Spectral 5.

If you need a specific untagged version from the past, just let me know the date and I'll create the missing tag.
Thanks! We will return to your offer if needed.

@ioggstream
Copy link
Collaborator Author

Consider extending fitko pagination rules to support configurable parameters

@ioggstream
Copy link
Collaborator Author

@AlessioMarinelli I updated the description. See the example schema for pagination fields. https://italia.github.io/api-oas-checker/?url=https://teamdigitale.github.io/openapi/master/definitions.yaml

@ioggstream
Copy link
Collaborator Author

Feel free to post your example OAS3 and I'll provide some comments on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Hacktoberfest rules Rules for interoperability and security
Projects
None yet
Development

No branches or pull requests

2 participants