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

fix: openapi playground parsing #1487

Merged
merged 17 commits into from
Jul 7, 2023

Conversation

TheGreatRefrigerator
Copy link
Contributor

@TheGreatRefrigerator TheGreatRefrigerator commented Jul 2, 2023

Pull Request Checklist

  • 1. I have rebased the latest version of the master branch into my feature branch and all conflicts
    have been resolved.
  • 2. I have added information about the change/addition to functionality to the CHANGELOG.md file under the
    [Unreleased] heading.
  • 3. I have documented my code using JDocs tags.
  • 4. I have removed unnecessary commented out code, imports and System.out.println statements.
  • 5. I have written JUnit tests for any new methods/classes and ensured that they pass.
  • 6. I have created API tests for any new functionality exposed to the API.
  • 7. If changes/additions are made to the ors-config.json file, I have added these to the ors config documentation
    along with a short description of what it is for, and documented this in the Pull Request (below).
  • 8. I have built graphs with my code of the Heidelberg.osm.gz file and run the api-tests with all test passing
  • 9. I have referenced the Issue Number in the Pull Request (if the changes were from an issue).
  • 10. For new features or changes involving building of graphs, I have tested on a larger dataset
    (at least Germany), and the graphs build without problems (i.e. no out-of-memory errors).
  • 11. For new features or changes involving the graphbuilding process (i.e. changing encoders, updating the
    importer etc.), I have generated longer distance routes for the affected profiles with different options
    (avoid features, max weight etc.) and compared these with the routes of the same parameters and start/end
    points generated from the current live ORS.
    If there are differences then the reasoning for these MUST be documented in the pull request.
  • 12. I have written in the Pull Request information about the changes made including their intended usage
    and why the change was needed.
  • 13. For changes touching the API documentation, I have tested that the API playground renders correctly.

Information about the changes

  • Key functionality added: fixes for OAS3 Specs
  • Reason for change: The springdoc.openapi annotations needed adjustments

@github-actions github-actions bot added the fix label Jul 2, 2023
@github-actions github-actions bot added fix and removed fix labels Jul 2, 2023
@TheGreatRefrigerator
Copy link
Contributor Author

added Changelog entry to 'changed' as the inital openapi change was merged without an entry.

@TheGreatRefrigerator TheGreatRefrigerator force-pushed the fix/openapi-playground-parsing branch from d0131bb to 60f50f5 Compare July 5, 2023 11:57
@TheGreatRefrigerator
Copy link
Contributor Author

dropped the profile JSON ignore commit that was removing provfile from metadata.query.profile -> removing from request object was resolved by changing to hidden-true in replace AccesMode for Schemas commit
fixed tests by adjusting spec test to changes
https://github.com/GIScience/openrouteservice/compare/d0131bb68c681ba2a29484e9a3e686d741b3fe60..60f50f5403351b3fc2dd3c7c27db9518a7dab2eb

@github-actions github-actions bot added fix and removed fix labels Jul 5, 2023
@TheGreatRefrigerator TheGreatRefrigerator force-pushed the fix/openapi-playground-parsing branch from 60f50f5 to 560989d Compare July 5, 2023 13:44
@github-actions github-actions bot added fix and removed fix labels Jul 5, 2023
@TheGreatRefrigerator TheGreatRefrigerator force-pushed the fix/openapi-playground-parsing branch from 560989d to 435e576 Compare July 5, 2023 14:57
@MichaelsJP
Copy link
Member

@TheGreatRefrigerator lgtm besides the failing test

@TheGreatRefrigerator
Copy link
Contributor Author

@TheGreatRefrigerator lgtm besides the failing test

will have one more look today with jakob on the port thing, and if nothing works put it back to default 8082.
It's really easy to just adjust the port when selecting the development provider.

@TheGreatRefrigerator TheGreatRefrigerator force-pushed the fix/openapi-playground-parsing branch from 435e576 to f1f9e2a Compare July 6, 2023 09:18
TheGreatRefrigerator and others added 5 commits July 7, 2023 15:13
Due to the Operation annotation being wrapped in the
RouterOperation annotation, the summary and description
weren't generated properly in the OAS3 spec output.

- add linebreaks for readability
- remove redundant (POST/GET) from Routing endpoint summaries

Co-authored-by: Jakob Schnell <jakob.schnell@heigit.org>
The swagger UI supports choosing the server to send requests
from the interactive docs to.
As we would like something similar for the Playground, we are
always adding server objects for
- api.openrouteservice.org
- localhost:{port}{baseUrl}

with the dynamic local server, the port and baseUrl can be
adjusted to the local configuration
this is redundant with the dynamic localhost server

- remove redundant swagger_documentation_url default
TheGreatRefrigerator and others added 12 commits July 7, 2023 15:46
this is used in the Playground, where other paths without V2
are listed as well.
there were some ominous accessMode Schema properties set to
READ_ONLY that didn't make any sense.

They were replaced with the correct property (hidden or required).
OAS 3 takes care of defaults via `defaultValue` and has an extension for
the validWhen-key. This makes the CUSTOM_KEY unnecessary.
- use OAS version 3.0 for usage with ui and parameter type
  for object parameters
- remove unused
- adjust swagger ui path
although objects represented by a java class are returned,
the response schema was using the @ArraySchema annotation.
This resulted in

```yaml
content:
  type: array
  items:
    $ref: ResponseObject
```

instead of the correct

```yaml
content:
  $ref: ResponseObject
```
@TheGreatRefrigerator TheGreatRefrigerator force-pushed the fix/openapi-playground-parsing branch from f1f9e2a to 46c9d85 Compare July 7, 2023 14:00
@TheGreatRefrigerator
Copy link
Contributor Author

rebased on master

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.

3 participants