[powershell] update doc to use backslash (#16460)

* add backslash, forwardslash lambda

* update api doc
This commit is contained in:
William Cheng
2023-08-31 14:29:01 +08:00
committed by GitHub
parent 4a1c70f2f1
commit 5954daea18
14 changed files with 175 additions and 82 deletions

View File

@@ -446,10 +446,13 @@ public class DefaultCodegen implements CodegenConfig {
.put("titlecase", new TitlecaseLambda())
.put("camelcase", new CamelCaseLambda(true).generator(this))
.put("pascalcase", new CamelCaseLambda(false).generator(this))
.put("forwardslash", new ForwardSlashLambda())
.put("backslash", new BackSlashLambda())
.put("indented", new IndentedLambda())
.put("indented_8", new IndentedLambda(8, " ", false))
.put("indented_12", new IndentedLambda(12, " ", false))
.put("indented_16", new IndentedLambda(16, " ", false));
}
private void registerMustacheLambdas() {

View File

@@ -43,9 +43,9 @@ import static org.openapitools.codegen.utils.StringUtils.camelize;
public class PowerShellClientCodegen extends DefaultCodegen implements CodegenConfig {
private final Logger LOGGER = LoggerFactory.getLogger(PowerShellClientCodegen.class);
private String packageGuid = "{" + randomUUID().toString().toUpperCase(Locale.ROOT) + "}";
protected String sourceFolder = "src";
protected String packageName = "PSOpenAPITools";
protected String packageVersion = "0.1.2";

View File

@@ -0,0 +1,45 @@
/*
* Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech)
*
* 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
*
* https://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 org.openapitools.codegen.templating.mustache;
import com.samskivert.mustache.Mustache;
import com.samskivert.mustache.Template;
import java.io.IOException;
import java.io.Writer;
import static org.openapitools.codegen.utils.StringUtils.underscore;
/**
* Replaces forward slash with backslash in the text.
*
* Register:
* <pre>
* additionalProperties.put("backslash", new BackSlashLambda());
* </pre>
*
* Use:
* <pre>
* {{#backslash}}{{summary}}{{/backslash}}
* </pre>
*/
public class BackSlashLambda implements Mustache.Lambda {
@Override
public void execute(Template.Fragment fragment, Writer writer) throws IOException {
writer.write(fragment.execute().replace("/", "\\"));
}
}

View File

@@ -0,0 +1,45 @@
/*
* Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech)
*
* 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
*
* https://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 org.openapitools.codegen.templating.mustache;
import com.samskivert.mustache.Mustache;
import com.samskivert.mustache.Template;
import java.io.IOException;
import java.io.Writer;
import static org.openapitools.codegen.utils.StringUtils.underscore;
/**
* Replaces backslash with forward slash in the text.
*
* Register:
* <pre>
* additionalProperties.put("forwardslash", new ForwardSlashLambda());
* </pre>
*
* Use:
* <pre>
* {{#fforwardslash}}{{summary}}{{/forwardslash}}
* </pre>
*/
public class ForwardSlashLambda implements Mustache.Lambda {
@Override
public void execute(Template.Fragment fragment, Writer writer) throws IOException {
writer.write(fragment.execute().replace("\\", "/"));
}
}

View File

@@ -71,7 +71,7 @@ Class | Method | HTTP request | Description
## Documentation for Models
{{#modelPackage}}
{{#models}}{{#model}} - [{{{modelPackage}}}.{{{classname}}}]({{modelDocPath}}{{{classname}}}.md)
{{#models}}{{#model}} - [{{#lambda.backslash}}{{{modelPackage}}}{{/lambda.backslash}}.{{{classname}}}]({{modelDocPath}}{{{classname}}}.md)
{{/model}}{{/models}}
{{/modelPackage}}
{{^modelPackage}}

View File

@@ -1,4 +1,4 @@
# {{packageName}}.{{apiPackage}}.{{classname}}{{#description}}
# {{packageName}}.{{#lambda.backslash}}{{apiPackage}}{{/lambda.backslash}}.{{classname}}{{#description}}
{{.}}{{/description}}
All URIs are relative to *{{{basePath}}}*

View File

@@ -98,78 +98,78 @@ Class | Method | HTTP request | Description
## Documentation for Models
- [PSPetstore/Model.AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md)
- [PSPetstore/Model.Animal](docs/Animal.md)
- [PSPetstore/Model.ApiResponse](docs/ApiResponse.md)
- [PSPetstore/Model.Apple](docs/Apple.md)
- [PSPetstore/Model.AppleReq](docs/AppleReq.md)
- [PSPetstore/Model.ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md)
- [PSPetstore/Model.ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md)
- [PSPetstore/Model.ArrayTest](docs/ArrayTest.md)
- [PSPetstore/Model.Banana](docs/Banana.md)
- [PSPetstore/Model.BananaReq](docs/BananaReq.md)
- [PSPetstore/Model.BasquePig](docs/BasquePig.md)
- [PSPetstore/Model.Capitalization](docs/Capitalization.md)
- [PSPetstore/Model.Cat](docs/Cat.md)
- [PSPetstore/Model.Category](docs/Category.md)
- [PSPetstore/Model.ClassModel](docs/ClassModel.md)
- [PSPetstore/Model.Client](docs/Client.md)
- [PSPetstore/Model.ComplexQuadrilateral](docs/ComplexQuadrilateral.md)
- [PSPetstore/Model.DanishPig](docs/DanishPig.md)
- [PSPetstore/Model.DeprecatedObject](docs/DeprecatedObject.md)
- [PSPetstore/Model.Dog](docs/Dog.md)
- [PSPetstore/Model.Drawing](docs/Drawing.md)
- [PSPetstore/Model.EnumArrays](docs/EnumArrays.md)
- [PSPetstore/Model.EnumTest](docs/EnumTest.md)
- [PSPetstore/Model.EquilateralTriangle](docs/EquilateralTriangle.md)
- [PSPetstore/Model.File](docs/File.md)
- [PSPetstore/Model.FileSchemaTestClass](docs/FileSchemaTestClass.md)
- [PSPetstore/Model.Foo](docs/Foo.md)
- [PSPetstore/Model.FooGetDefaultResponse](docs/FooGetDefaultResponse.md)
- [PSPetstore/Model.FormatTest](docs/FormatTest.md)
- [PSPetstore/Model.Fruit](docs/Fruit.md)
- [PSPetstore/Model.FruitReq](docs/FruitReq.md)
- [PSPetstore/Model.GmFruit](docs/GmFruit.md)
- [PSPetstore/Model.GrandparentAnimal](docs/GrandparentAnimal.md)
- [PSPetstore/Model.HasOnlyReadOnly](docs/HasOnlyReadOnly.md)
- [PSPetstore/Model.HealthCheckResult](docs/HealthCheckResult.md)
- [PSPetstore/Model.IsoscelesTriangle](docs/IsoscelesTriangle.md)
- [PSPetstore/Model.List](docs/List.md)
- [PSPetstore/Model.Mammal](docs/Mammal.md)
- [PSPetstore/Model.MapTest](docs/MapTest.md)
- [PSPetstore/Model.MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md)
- [PSPetstore/Model.Model200Response](docs/Model200Response.md)
- [PSPetstore/Model.ModelReturn](docs/ModelReturn.md)
- [PSPetstore/Model.Name](docs/Name.md)
- [PSPetstore/Model.NullableClass](docs/NullableClass.md)
- [PSPetstore/Model.NullableShape](docs/NullableShape.md)
- [PSPetstore/Model.NumberOnly](docs/NumberOnly.md)
- [PSPetstore/Model.ObjectWithDeprecatedFields](docs/ObjectWithDeprecatedFields.md)
- [PSPetstore/Model.Order](docs/Order.md)
- [PSPetstore/Model.OuterComposite](docs/OuterComposite.md)
- [PSPetstore/Model.OuterEnum](docs/OuterEnum.md)
- [PSPetstore/Model.OuterEnumDefaultValue](docs/OuterEnumDefaultValue.md)
- [PSPetstore/Model.OuterEnumInteger](docs/OuterEnumInteger.md)
- [PSPetstore/Model.OuterEnumIntegerDefaultValue](docs/OuterEnumIntegerDefaultValue.md)
- [PSPetstore/Model.ParentPet](docs/ParentPet.md)
- [PSPetstore/Model.Pet](docs/Pet.md)
- [PSPetstore/Model.PetWithRequiredTags](docs/PetWithRequiredTags.md)
- [PSPetstore/Model.Pig](docs/Pig.md)
- [PSPetstore/Model.Quadrilateral](docs/Quadrilateral.md)
- [PSPetstore/Model.QuadrilateralInterface](docs/QuadrilateralInterface.md)
- [PSPetstore/Model.ReadOnlyFirst](docs/ReadOnlyFirst.md)
- [PSPetstore/Model.ScaleneTriangle](docs/ScaleneTriangle.md)
- [PSPetstore/Model.Shape](docs/Shape.md)
- [PSPetstore/Model.ShapeInterface](docs/ShapeInterface.md)
- [PSPetstore/Model.ShapeOrNull](docs/ShapeOrNull.md)
- [PSPetstore/Model.SimpleQuadrilateral](docs/SimpleQuadrilateral.md)
- [PSPetstore/Model.SpecialModelName](docs/SpecialModelName.md)
- [PSPetstore/Model.Tag](docs/Tag.md)
- [PSPetstore/Model.Triangle](docs/Triangle.md)
- [PSPetstore/Model.TriangleInterface](docs/TriangleInterface.md)
- [PSPetstore/Model.User](docs/User.md)
- [PSPetstore/Model.Whale](docs/Whale.md)
- [PSPetstore/Model.Zebra](docs/Zebra.md)
- [PSPetstore\Model.AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md)
- [PSPetstore\Model.Animal](docs/Animal.md)
- [PSPetstore\Model.ApiResponse](docs/ApiResponse.md)
- [PSPetstore\Model.Apple](docs/Apple.md)
- [PSPetstore\Model.AppleReq](docs/AppleReq.md)
- [PSPetstore\Model.ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md)
- [PSPetstore\Model.ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md)
- [PSPetstore\Model.ArrayTest](docs/ArrayTest.md)
- [PSPetstore\Model.Banana](docs/Banana.md)
- [PSPetstore\Model.BananaReq](docs/BananaReq.md)
- [PSPetstore\Model.BasquePig](docs/BasquePig.md)
- [PSPetstore\Model.Capitalization](docs/Capitalization.md)
- [PSPetstore\Model.Cat](docs/Cat.md)
- [PSPetstore\Model.Category](docs/Category.md)
- [PSPetstore\Model.ClassModel](docs/ClassModel.md)
- [PSPetstore\Model.Client](docs/Client.md)
- [PSPetstore\Model.ComplexQuadrilateral](docs/ComplexQuadrilateral.md)
- [PSPetstore\Model.DanishPig](docs/DanishPig.md)
- [PSPetstore\Model.DeprecatedObject](docs/DeprecatedObject.md)
- [PSPetstore\Model.Dog](docs/Dog.md)
- [PSPetstore\Model.Drawing](docs/Drawing.md)
- [PSPetstore\Model.EnumArrays](docs/EnumArrays.md)
- [PSPetstore\Model.EnumTest](docs/EnumTest.md)
- [PSPetstore\Model.EquilateralTriangle](docs/EquilateralTriangle.md)
- [PSPetstore\Model.File](docs/File.md)
- [PSPetstore\Model.FileSchemaTestClass](docs/FileSchemaTestClass.md)
- [PSPetstore\Model.Foo](docs/Foo.md)
- [PSPetstore\Model.FooGetDefaultResponse](docs/FooGetDefaultResponse.md)
- [PSPetstore\Model.FormatTest](docs/FormatTest.md)
- [PSPetstore\Model.Fruit](docs/Fruit.md)
- [PSPetstore\Model.FruitReq](docs/FruitReq.md)
- [PSPetstore\Model.GmFruit](docs/GmFruit.md)
- [PSPetstore\Model.GrandparentAnimal](docs/GrandparentAnimal.md)
- [PSPetstore\Model.HasOnlyReadOnly](docs/HasOnlyReadOnly.md)
- [PSPetstore\Model.HealthCheckResult](docs/HealthCheckResult.md)
- [PSPetstore\Model.IsoscelesTriangle](docs/IsoscelesTriangle.md)
- [PSPetstore\Model.List](docs/List.md)
- [PSPetstore\Model.Mammal](docs/Mammal.md)
- [PSPetstore\Model.MapTest](docs/MapTest.md)
- [PSPetstore\Model.MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md)
- [PSPetstore\Model.Model200Response](docs/Model200Response.md)
- [PSPetstore\Model.ModelReturn](docs/ModelReturn.md)
- [PSPetstore\Model.Name](docs/Name.md)
- [PSPetstore\Model.NullableClass](docs/NullableClass.md)
- [PSPetstore\Model.NullableShape](docs/NullableShape.md)
- [PSPetstore\Model.NumberOnly](docs/NumberOnly.md)
- [PSPetstore\Model.ObjectWithDeprecatedFields](docs/ObjectWithDeprecatedFields.md)
- [PSPetstore\Model.Order](docs/Order.md)
- [PSPetstore\Model.OuterComposite](docs/OuterComposite.md)
- [PSPetstore\Model.OuterEnum](docs/OuterEnum.md)
- [PSPetstore\Model.OuterEnumDefaultValue](docs/OuterEnumDefaultValue.md)
- [PSPetstore\Model.OuterEnumInteger](docs/OuterEnumInteger.md)
- [PSPetstore\Model.OuterEnumIntegerDefaultValue](docs/OuterEnumIntegerDefaultValue.md)
- [PSPetstore\Model.ParentPet](docs/ParentPet.md)
- [PSPetstore\Model.Pet](docs/Pet.md)
- [PSPetstore\Model.PetWithRequiredTags](docs/PetWithRequiredTags.md)
- [PSPetstore\Model.Pig](docs/Pig.md)
- [PSPetstore\Model.Quadrilateral](docs/Quadrilateral.md)
- [PSPetstore\Model.QuadrilateralInterface](docs/QuadrilateralInterface.md)
- [PSPetstore\Model.ReadOnlyFirst](docs/ReadOnlyFirst.md)
- [PSPetstore\Model.ScaleneTriangle](docs/ScaleneTriangle.md)
- [PSPetstore\Model.Shape](docs/Shape.md)
- [PSPetstore\Model.ShapeInterface](docs/ShapeInterface.md)
- [PSPetstore\Model.ShapeOrNull](docs/ShapeOrNull.md)
- [PSPetstore\Model.SimpleQuadrilateral](docs/SimpleQuadrilateral.md)
- [PSPetstore\Model.SpecialModelName](docs/SpecialModelName.md)
- [PSPetstore\Model.Tag](docs/Tag.md)
- [PSPetstore\Model.Triangle](docs/Triangle.md)
- [PSPetstore\Model.TriangleInterface](docs/TriangleInterface.md)
- [PSPetstore\Model.User](docs/User.md)
- [PSPetstore\Model.Whale](docs/Whale.md)
- [PSPetstore\Model.Zebra](docs/Zebra.md)
<a id="documentation-for-authorization"></a>

View File

@@ -1,4 +1,4 @@
# PSPetstore.PSPetstore/Api.PSAnotherFakeApi
# PSPetstore.PSPetstore\Api.PSAnotherFakeApi
All URIs are relative to *http://petstore.swagger.io:80/v2*

View File

@@ -1,4 +1,4 @@
# PSPetstore.PSPetstore/Api.PSDefaultApi
# PSPetstore.PSPetstore\Api.PSDefaultApi
All URIs are relative to *http://petstore.swagger.io:80/v2*

View File

@@ -1,4 +1,4 @@
# PSPetstore.PSPetstore/Api.PSFakeApi
# PSPetstore.PSPetstore\Api.PSFakeApi
All URIs are relative to *http://petstore.swagger.io:80/v2*

View File

@@ -1,4 +1,4 @@
# PSPetstore.PSPetstore/Api.PSFakeClassnameTags123Api
# PSPetstore.PSPetstore\Api.PSFakeClassnameTags123Api
All URIs are relative to *http://petstore.swagger.io:80/v2*

View File

@@ -1,4 +1,4 @@
# PSPetstore.PSPetstore/Api.PSPetApi
# PSPetstore.PSPetstore\Api.PSPetApi
All URIs are relative to *http://petstore.swagger.io:80/v2*

View File

@@ -1,4 +1,4 @@
# PSPetstore.PSPetstore/Api.PSStoreApi
# PSPetstore.PSPetstore\Api.PSStoreApi
All URIs are relative to *http://petstore.swagger.io:80/v2*

View File

@@ -1,4 +1,4 @@
# PSPetstore.PSPetstore/Api.PSUserApi
# PSPetstore.PSPetstore\Api.PSUserApi
All URIs are relative to *http://petstore.swagger.io:80/v2*