-
Notifications
You must be signed in to change notification settings - Fork 193
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
[FEATURE REQ] - Export Policy as XML instead of RAWXML #587
Comments
|
Thanks, @Banchio. The proposal makes sense. Please wait until our next RC release with support for workspaces though (should be sometime next week). Don't want you to make changes while the code-base shifts under you. |
@Banchio I added your proposal as a task on the apiops board. Once we release v6 rc2 you can start implementing the feature and submit a pr so we can review and merge. Please let me know when you start implementing so I can move the task to in progress status. Thanks in advance for your contributions. |
@Banchio - code has been merged to main, please feel free to start working on this. The code base has changed significantly since your last PR, so don't hesitate to ask any questions. |
thanks @guythetechie, may I ask you to have a look at this commit on my fork? I basically expect a new parameter and pass it wherever there's a policy export. Do you think we have impact on publisher as well? |
Looks great, thanks! The publisher will be impacted as well; it expects a format in the policy apiops/tools/code/publisher/ApiPolicy.cs Line 148 in bf5cc12
Since it's needed in both the extractor and publisher, your GetDto(this ProductPolicyUri uri, HttpPipeline pipeline, CancellationToken cancellationToken, string policyFormat) to this: GetDto(this ProductPolicyUri uri, HttpPipeline pipeline, CancellationToken cancellationToken, DefaultPolicySpecification policyFormat) One last thing: the REST API calls this
|
thank you @guythetechie very detailed. I tried to implement what you said. Specifically renamed to Policy Content Format and moved to common. I did not understand the DefaultPolicyContentFormat object in the extractor, I parsed the parameter and inject in the DI the object defined in the common have a look here. Branch: xml-fromconfig branch |
@Banchio - What you have looks great. Here is what I was suggesting, but it's not necessary. For API specifications, we have an
In the extractor though, we also have a
The advantage of also having a Right now, the only use case for passing API specifications in DI is to refer to the default value passed in configuration. We could get away just using Hope this makes sense. I can't think of any other reason why we would want to pass the policy content format in DI, which is why I think your implementation is fine. Adding a second I'll let you make that choice. If you decide not to implement a |
Please describe the feature.
Related to #488
Re-posting this as the new version goes toward definitive release. When exporting policies, the rawxml format is not valid for other programmatic scenario (think of select-xml cmdlet in powershell).
Proposal is to add a new parameter POLICY_SPECIFICATION_FORMAT with two values: rawxml, default one as of today and xml which export policies in the escaped format.
This setting and behavior was proposed in this PR #489 , I can try to reimplement that login in the new version but do not want to waste time if this get refused again. Thanks
The text was updated successfully, but these errors were encountered: