Refactor resolveRef to perserve components in OpenAPI Documents
This commit updates the resovleRef function ti maintain the integrity of the original OpenAPI document. Previously, the function removed resolved components from the document's components section, which led to issues in subsequent reuse of the document, especially in test environments where the same document was dereferenced multiple times.
The refacotring includes:
= Removing the logic that deletes components from the root document after resolution.
Adjusting related functions to align with this change (UnitTests)
This change ensures that eash test or operation that involves dereferencing an OpenAPI document works with a complete and unaltered version of the document, thereby preventing errors related to missing components in later tests or operations. It enhances the reliability and repeatability of tests and operations that depend on the OpenAPI document.
Feat: Adding New Spectral Ruleset
This commit introduces a new set of Spectral rules specifically tailored for validating JSON:API v1.0 Resource Objects Attributes within an OpenAPI Document. Key highlights include:
Creation of Spectral rules to ensure compliance with JSON:API v1.0 standards, focusing on Resource Objects Attributes specifications.
Ensuring attributes do not contain any relationships member or links member and no foreign keys.
These additions significantly improve our capability to automatically validate and ensure the consistency of API responses with the JSON:API v1.0 standard.
Enhance: refactored valid OpenAPI Template
This document serves as a standardized template for verifying positive test scenarios in ruleset development. To ensure that the document can be tested against multiple rulesets, the design and endpoints were refactored. This document is now closer to adhering to JSON:API v1.0 specifications. Covered sections include:
ContentNegotiation.ClientResponsibilities
ContentNegotiation.ServerResponsibilities
DocumentStructure
DocumentStructure.TopLevel
DocumentStructure.ResourceObjects
DocumentStructure.ResourceObjects.Attributes
DocumentStructure.Links
DocumentStructure.MetaInformation
DocumentStructure.MemberNames
FetchingData.Sorting
FetchingData.Pagination
FetchingData.Filtering
Errors.ProcessingErrors
Errors.ErrorObjects
Feat: Test Case Completion
This commit marks the completion of detailed test cases for all of the JSON:API v1.0 Document Structure Resource Objects Attributes ruleset:
These updates significantly improve the robustness and relaibility of the JSON:API v1.0 specifications for Resource Objects Attributes validation process.
Feat: Passing/Failing OpenAPI Documents for Spectral CLI Testing
These two files provides a way to test al lthe created rules for both positive and negative scenarios.
Created a failing-rules.yaml which generates a way to trigger all the rules to display the error message
Updated the passing-rules.yaml to adhere to the specifications of JSON:API v1.0 for attributes.
Providing comment for status codes
Increase global timeout for Mocha tests to 10000ms
Extended the default timeout setting for Mocha tests to 10000 milliseconds. This change addresses issues with asynchronous test exceeding the previous 2000ms default timeout, ensuring more reliable test executions, particularly in environments with variable response times or for tests requiring extended execution time.
Refactor: Centralize dereferncing of validApiDocument globally
This commit centralizes the dereferencing of validApiDocument in our test suites by moving it to a global scope. The primary motivations for this change are performance optimization and resolving issues related to multiple dereferencings.
Key Changes and Reasons:
Performance Optimization:
As our API template grows, the number of test cases that require a dereferenced version of validApiDocument is increasing.
Previously, each test file was individually dereferencing this document, which is a resource-intensive process. By dereferencing it once globally, we reduce the computational overhead significantly.
This global approach ensures that all tests use the same dereferenced instance, improving the overall efficiency of our test execution.
Resolving Multiple Dereferencing Issues:
In our prior setup, attempting to dereference an already dereferenced document in different test files led to inconsistencies and potential errors.
By having a single, globally dereferenced document, we eliminate the risk of such issues. This ensures that all tests work with a consistent and stable version of the API document.
Maintainability and Consistency:
This refactor simplifies the test setup by removing redundant dereferencing logic in multiple files.
It also enhances the consistency across our test suites, making it easier for the team to write and maintain tests.
By making this change, we are aligning our testing practices with best practices for efficiency, stability, and maintainability. This update is crucial for handling the increasing complexity of our API testing as the project grows.
API-54 Error.ProcessingErrors (#57)
This commit updates the resovleRef function ti maintain the integrity of the original OpenAPI document. Previously, the function removed resolved components from the document's
components
section, which led to issues in subsequent reuse of the document, especially in test environments where the same document was dereferenced multiple times.The refacotring includes: = Removing the logic that deletes components from the root document after resolution.
This change ensures that eash test or operation that involves dereferencing an OpenAPI document works with a complete and unaltered version of the document, thereby preventing errors related to missing components in later tests or operations. It enhances the reliability and repeatability of tests and operations that depend on the OpenAPI document.
This commit introduces a new set of Spectral rules specifically tailored for validating JSON:API v1.0 Resource Objects Attributes within an OpenAPI Document. Key highlights include:
attributes
do not contain anyrelationships
member orlinks
member and no foreign keys.These additions significantly improve our capability to automatically validate and ensure the consistency of API responses with the JSON:API v1.0 standard.
This document serves as a standardized template for verifying positive test scenarios in ruleset development. To ensure that the document can be tested against multiple rulesets, the design and endpoints were refactored. This document is now closer to adhering to JSON:API v1.0 specifications. Covered sections include:
ContentNegotiation.ClientResponsibilities
ContentNegotiation.ServerResponsibilities
DocumentStructure
DocumentStructure.TopLevel
DocumentStructure.ResourceObjects
DocumentStructure.ResourceObjects.Attributes
DocumentStructure.Links
DocumentStructure.MetaInformation
DocumentStructure.MemberNames
FetchingData.Sorting
FetchingData.Pagination
FetchingData.Filtering
Errors.ProcessingErrors
Errors.ErrorObjects
Feat: Test Case Completion
This commit marks the completion of detailed test cases for all of the JSON:API v1.0 Document Structure Resource Objects Attributes ruleset:
These updates significantly improve the robustness and relaibility of the JSON:API v1.0 specifications for Resource Objects Attributes validation process.
Feat: Passing/Failing OpenAPI Documents for Spectral CLI Testing
These two files provides a way to test al lthe created rules for both positive and negative scenarios.
Created a failing-rules.yaml which generates a way to trigger all the rules to display the error message
Updated the passing-rules.yaml to adhere to the specifications of JSON:API v1.0 for attributes.
Providing comment for status codes
Increase global timeout for Mocha tests to 10000ms
Extended the default timeout setting for Mocha tests to 10000 milliseconds. This change addresses issues with asynchronous test exceeding the previous 2000ms default timeout, ensuring more reliable test executions, particularly in environments with variable response times or for tests requiring extended execution time.
Key Changes and Reasons:
Performance Optimization:
Resolving Multiple Dereferencing Issues:
Maintainability and Consistency:
By making this change, we are aligning our testing practices with best practices for efficiency, stability, and maintainability. This update is crucial for handling the increasing complexity of our API testing as the project grows.