Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(pipelinetemplate): Removing handlebars rendering option (#1272)
- Loading branch information
1 parent
b44e6ec
commit b37c2ad
Showing
13 changed files
with
62 additions
and
652 deletions.
There are no files selected for viewing
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
103 changes: 0 additions & 103 deletions
103
.../java/com/netflix/spinnaker/orca/pipelinetemplate/v1schema/render/HandlebarsRenderer.java
This file was deleted.
Oops, something went wrong.
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
56 changes: 56 additions & 0 deletions
56
.../java/com/netflix/spinnaker/orca/pipelinetemplate/v1schema/render/filters/JsonFilter.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* | ||
* Copyright 2017 Netflix, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package com.netflix.spinnaker.orca.pipelinetemplate.v1schema.render.filters; | ||
|
||
import com.fasterxml.jackson.core.JsonProcessingException; | ||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
import com.hubspot.jinjava.interpret.InterpretException; | ||
import com.hubspot.jinjava.interpret.JinjavaInterpreter; | ||
import com.hubspot.jinjava.lib.filter.Filter; | ||
import com.netflix.spinnaker.orca.pipelinetemplate.exceptions.TemplateRenderException; | ||
import com.netflix.spinnaker.orca.pipelinetemplate.validator.Errors.Error; | ||
|
||
public class JsonFilter implements Filter { | ||
|
||
private ObjectMapper objectMapper; | ||
|
||
public JsonFilter(ObjectMapper objectMapper) { | ||
this.objectMapper = objectMapper; | ||
} | ||
|
||
@Override | ||
public Object filter(Object var, JinjavaInterpreter interpreter, String... args) { | ||
if (args.length != 0) { | ||
throw new InterpretException("json filter does accept any arguments"); | ||
} | ||
|
||
try { | ||
return objectMapper.writeValueAsString(var); | ||
} catch (JsonProcessingException e) { | ||
throw TemplateRenderException.fromError( | ||
new Error() | ||
.withMessage("failed converting object to json") | ||
.withDetail("object", (String) var), | ||
e | ||
); | ||
} | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
return "json"; | ||
} | ||
} |
108 changes: 0 additions & 108 deletions
108
...a/com/netflix/spinnaker/orca/pipelinetemplate/v1schema/render/helper/ConditionHelper.java
This file was deleted.
Oops, something went wrong.
44 changes: 0 additions & 44 deletions
44
...n/java/com/netflix/spinnaker/orca/pipelinetemplate/v1schema/render/helper/JsonHelper.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.