-
Notifications
You must be signed in to change notification settings - Fork 14
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
Url proxy endpoint featuring OpenAPI #141
Merged
kasperg
merged 34 commits into
release/4
from
opsaet-openapi-understottelse-og-ensretning-af-rest-api-opsaetning-DDFSOEG-245
Oct 6, 2022
Merged
Url proxy endpoint featuring OpenAPI #141
kasperg
merged 34 commits into
release/4
from
opsaet-openapi-understottelse-og-ensretning-af-rest-api-opsaetning-DDFSOEG-245
Oct 6, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
and modified dpl_url_proxy setup/test
By using a ParamConverter and url encoding json. Following data works after /dpl-url-proxy/ : { "scheme": "http", "host": "john.com", "port": "", "path": "", "query": "kalle=1", "fragment": "" } It results in following url: %7B%0A%20%20%22scheme%22%3A%20%22http%22%2C%0A%20%20%22host%22%3A%20%22john.com%22%2C%0A%20%20%22port%22%3A%20%22%22%2C%0A%20%20%22path%22%3A%20%22%22%2C%0A%20%20%22query%22%3A%20%22kalle%3D1%22%2C%0A%20%20%22fragment%22%3A%20%22%22%0A%7D%0A PhpUnitTest breaks now though because: * The endpoint urls in tests needs to be updated with new url structure * The UrlParamConverter does not seem to be loaded in test context
It is nice to have a sensible order.
Otherwise we will not be able to use it with other programmatic tools.
This is necessary for us to be able to specify the API at a level where it is usable for us in client generation.
This way we avoid a lot of complexity caused by wonky encoding required by the url param converter. Patches to the OpenAPI REST module means that we will be able to specify query parameter structure anyway.
This is now handled by our rest resource instead.
There is no need for a double nested objects. An object with an url key should do fine. Specifying this is now supported through our patches to the OpenAPI REST module.
We need to explicitly specify the XDEBUG mode for this to work. - coverage: This gets us coverage needed for output - debug: This enables step debugging which can be helpful when writing unit tests
There is no need to keep it a secret and having it available is useful for automations.
This allows us to use the API with other tools without having a running site. Also it allows us to detect changes to the specification which may occur unintentionally as it partly autogenerated based on configuration. Our specification it somewhat handheld so ensuring that it is valid is also helpful. Node tools swagger-cli and jsome helps us with validation and formatting.
These are individual per site and should not be overwritten with future updates. By keeping the configuration a part of the ignored settings we ensure this.
This is in line with other modules
This allows us to return metadata about this response, links etc. Update the specification accordingly
They should not be enabled by default on production sites.
We have decided on using OpenAPI and REST for API development and specification. Thus we no longer need modules related to JSON:API. OpenAPI UI Redoc is not necessary for us to work with or expose our API so remove it entirely. This reduces our code surface.
Ddfsoeg 245 part 2
This is not needed for JavaScript code - only JSON.
The default 4x throttle is not relevant when running Lighthouse in containers or in GitHub Actions.
The cpu multiplier value must be wrapped in a throttling entry.
It has been replaced by the url proxy resource
Use query args as cache context. It is more specific to what we are doing. Also remember to use snake_case instead of camelCase for variables.
cableman
suggested changes
Oct 6, 2022
cableman
approved these changes
Oct 6, 2022
kasperg
deleted the
opsaet-openapi-understottelse-og-ensretning-af-rest-api-opsaetning-DDFSOEG-245
branch
October 6, 2022 13:53
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Link to issue
https://reload.atlassian.net/browse/DDFSOEG-245
Description
The purpose of this PR is twofold:
UrlProxyResource
class.This PR does the following:
composer.json
openapi.json
openapi.json
specification stays valid and does not driftChecklist