-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Make it possible to add custom API documentation based on the deployment location #6355
base: dev-2.x
Are you sure you want to change the base?
Conversation
…eplacer. This enable us to use this in places where we do not want to inject environment variables.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev-2.x #6355 +/- ##
=============================================
- Coverage 69.85% 69.82% -0.03%
- Complexity 17926 17993 +67
=============================================
Files 2035 2050 +15
Lines 76508 76792 +284
Branches 7825 7840 +15
=============================================
+ Hits 53442 53619 +177
- Misses 20325 20424 +99
- Partials 2741 2749 +8 ☔ View full report in Codecov by Sentry. |
In the case used, we compare to GraphQL schemas.
4de6666
to
0bf3c72
Compare
1f4cae2
to
f2406e7
Compare
...rc/main/java/org/opentripplanner/apis/support/graphql/injectdoc/ApiDocumentationProfile.java
Outdated
Show resolved
Hide resolved
...on/src/main/java/org/opentripplanner/apis/support/graphql/injectdoc/CustomDocumentation.java
Outdated
Show resolved
Hide resolved
...on/src/main/java/org/opentripplanner/apis/support/graphql/injectdoc/CustomDocumentation.java
Outdated
Show resolved
Hide resolved
.../main/java/org/opentripplanner/apis/support/graphql/injectdoc/InjectCustomDocumentation.java
Outdated
Show resolved
Hide resolved
...t/java/org/opentripplanner/apis/support/graphql/injectdoc/InjectCustomDocumentationTest.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a few things that I picked up on, mainly that properties files in Java are assumed to be ISO-8869-1.
.../main/java/org/opentripplanner/apis/support/graphql/injectdoc/InjectCustomDocumentation.java
Outdated
Show resolved
Hide resolved
...t/java/org/opentripplanner/apis/support/graphql/injectdoc/InjectCustomDocumentationTest.java
Show resolved
Hide resolved
Co-authored-by: Leonard Ehrenfried <[email protected]>
06b76b4
to
106ab13
Compare
Summary
This PR introduce a new configuration parameter to load a deployment specific properies file.
router-config.json
custom-documentation-entur.properties
Syntax properties file
Use:
<TypeName>[.<FieldName>].(description|deprecated)[.append]
Examples
Replace the existing type description
Quay.description=The place for boarding/alighting a vehicle
Append to the existing type description
Quay.description.append=This is appended
Replace the existing field description
Quay.name.description=The name of a Quay is ...
Append to the existing field description
Quay.name.description.append=(Source NSR)
Insert deprecated reason. Due to a bug in the Java GraphQL lib, an existing deprecated reason cannot be updated, but it can be deprecated if not already marked. Deleting the reason from the schema, and adding it back using
the "default" TransmodelApiDocumentationProfile can be used as a workaround. The problem is reported to the Java GraphQL Prodject here: graphql-java/graphql-java#3786.
Quay.name.deprecated=This field is deprecated ...
Issue
🟥 No isse exist for this.
Unit tests
✅ All new code have unit-tests
Documentation
✅ JavaDoc and user doc is added/updated.
Changelog
✅ This is a new feature
Bumping the serialization version id
🟥 Not needed