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

IBX-6107: REST API ref tester #1901

Draft
wants to merge 40 commits into
base: master
Choose a base branch
from
Draft

Conversation

adriendupuis
Copy link
Contributor

@adriendupuis adriendupuis commented Feb 17, 2023

Question Answer
JIRA Ticket IBX-6107, IBX-1430
Versions N/A
Edition N/A

Compares the REST API reference to DXP config.

This tool helps to find missing REST routes, missing REST route methods and non-existent REST routes.
It extracts reference routes from the HTML output of the raml2html build. It extracts configuration routes from the yaml files of the DXP. It compares routes existng only on one side and it compares methods of common routes. When a route doesn't exists on one side, it tries few argument renamings (like Id↔︎Identifier) or if the route if flagged (removed) (see #1642 for the unification of depreciation and removal flags).

Checklist

  • Text renders correctly
  • Text has been checked with vale
  • Description metadata is up to date
  • Redirects cover removed/moved pages
  • Code samples are working
  • PHP code samples have been fixed with PHP CS fixer
  • Added link to this PR in relevant JIRA ticket or code PR

@adriendupuis adriendupuis changed the title REST API ref tester IBX-1430: REST API ref tester Feb 17, 2023
@adriendupuis
Copy link
Contributor Author

Splitted from #1642
See #1642 (comment) for an early comment.

To generate static HTML from RAML definitions, use the following code from project root:

```sh
php tools/raml2html/raml2html.php build --non-standard-http-methods=COPY,MOVE,PUBLISH,SWAP -t default -o docs/api/rest_api/rest_api_reference/output/ docs/api/rest_api/rest_api_reference/input/ez.raml
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no need to use a temporary location.

Suggested change
php tools/raml2html/raml2html.php build --non-standard-http-methods=COPY,MOVE,PUBLISH,SWAP -t default -o docs/api/rest_api/rest_api_reference/output/ docs/api/rest_api/rest_api_reference/input/ez.raml
php tools/raml2html/raml2html.php build --non-standard-http-methods=COPY,MOVE,PUBLISH,SWAP -t default -o docs/api/rest_api/rest_api_reference/ docs/api/rest_api/rest_api_reference/input/ez.raml

Comment on lines 13 to 26
public const DEFAULT_FILE_LIST = [
'vendor/ibexa/rest/src/bundle/Resources/config/routing.yml',
//'vendor/ibexa/commerce-rest/src/bundle/Resources/config/routing.yaml', // Removed as of 4.4
// `find $dxpRoot/vendor/ibexa -name "routing_rest.y*ml"`
//'vendor/ibexa/admin-ui/src/bundle/Resources/config/routing_rest.yaml',
'vendor/ibexa/calendar/src/bundle/Resources/config/routing_rest.yaml',
'vendor/ibexa/cart/src/bundle/Resources/config/routing_rest.yaml',
'vendor/ibexa/connector-dam/src/bundle/Resources/config/routing_rest.yaml',
'vendor/ibexa/personalization/src/bundle/Resources/config/routing_rest.yaml',
'vendor/ibexa/product-catalog/src/bundle/Resources/config/routing_rest.yaml',
//'vendor/ibexa/scheduler/src/bundle/Resources/config/routing_rest.yaml', // prefixed /api/datebasedpublisher/v1
'vendor/ibexa/segmentation/src/bundle/Resources/config/routing_rest.yaml',
'vendor/ibexa/taxonomy/src/bundle/Resources/config/routing_rest.yaml',
];
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't be there but in an independent config file to ease variation between versions.

For 4.3, uncomment 'vendor/ibexa/commerce-rest/src/bundle/Resources/config/routing.yaml'
For 3.3, use

    public const DEFAULT_FILE_LIST = [
        'vendor/ezsystems/ezplatform-rest/src/bundle/Resources/config/routing.yml',
        'vendor/ezsystems/ezcommerce-rest/src/Siso/RestBundle/Resources/config/routing.yaml',
        // `find $dxpRoot/vendor/ezsystems -name "routing_rest.y*ml"`
        //'vendor/ezsystems/ezplatform-admin-ui/src/bundle/Resources/config/routing_rest.yaml',
        'vendor/ezsystems/date-based-publisher/bundle/Resources/config/routing_rest.yaml',
        'vendor/ezsystems/ezplatform-calendar/src/bundle/Resources/config/routing_rest.yaml',
        'vendor/ezsystems/ezplatform-connector-dam/src/bundle/Resources/config/routing_rest.yaml',
        'vendor/ezsystems/ezrecommendation-client/src/bundle/Resources/config/routing_rest.yaml',
    ];

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There will be the addition of vendor/ibexa/corporate-account/src/bundle/Resources/config/routing_rest.yaml to 4.x, see https://github.com/ibexa/corporate-account/pull/155/files#diff-cd2d6c168e688c1fe9908fbfeb46faca08e464562c38a143e38c16a6bdd1b246 and #1930

@adriendupuis adriendupuis changed the title IBX-1430: REST API ref tester IBX-6107: REST API ref tester Jun 30, 2023
@adriendupuis adriendupuis mentioned this pull request Apr 29, 2024
7 tasks
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

Successfully merging this pull request may close these issues.

1 participant