diff --git a/docs/how_to.md b/docs/how_to.md index de7306b0a..b68b80877 100644 --- a/docs/how_to.md +++ b/docs/how_to.md @@ -394,7 +394,7 @@ x-terraform-immutable | boolean | The field will be used to create a brand new x-terraform-force-new | boolean | If the value of this property is updated; terraform will delete the previously created resource and create a new one with this value x-terraform-sensitive | boolean | If this meta attribute is present in an object definition property, it will be considered sensitive as far as terraform is concerned, meaning that its value will not be disclosed in the TF state file x-terraform-id | boolean | If this meta attribute is present in an object definition property, the value will be used as the resource identifier when performing the read, update and delete API operations. The value will also be stored in the ID field of the local state file. -x-terraform-field-name | string | This enables service providers to override the schema definition property name with a different one which will be the property name used in the terraform configuration file. This is mostly used to expose the internal property to a more user friendly name. If the extension is not present and the property name is not terraform compliant, an automatic convertion will be performed by the OpenAPI Terraform provider to make the name compliant (following Terraform's field name convention to be snake_case) +x-terraform-field-name | string | This enables service providers to override the schema definition property name with a different one which will be the property name used in the terraform configuration file. This is mostly used to expose the internal property to a more user friendly name. If the extension is not present and the property name is not terraform compliant, an automatic conversion will be performed by the OpenAPI Terraform provider to make the name compliant (following Terraform's field name convention to be snake_case) ##### Full Example @@ -446,7 +446,7 @@ definitions: type: string x-terraform-sensitive: true - someNonUserFriendlyPropertyName: # If this property did not have the 'x-terraform-field-name' extension, the property name will be automatically converted by the OpenAPI Terraform provider into a name that is Terraform field name compliant. The result will be: some_non_user_friendly_property_name + someNonUserFriendlyPropertyName: # If this property did not have the 'x-terraform-field-name' extension, the property name will be automatically converted by the OpenAPI Terraform provider into a name that is Terraform field name compliant. The result will be: some_non_user_friendly_propertyName type: string x-terraform-field-name: property_name_more_user_friendly ``` diff --git a/examples/swaggercodegen/api/api/auth.go b/examples/swaggercodegen/api/api/auth.go index a3ddd118e..6a6355057 100644 --- a/examples/swaggercodegen/api/api/auth.go +++ b/examples/swaggercodegen/api/api/auth.go @@ -8,7 +8,7 @@ import ( func AuthenticateRequest(r *http.Request, w http.ResponseWriter) error { apiKey := r.Header.Get("Authorization") - if apiKey == "" || apiKey != "apiKeyValue" { + if apiKey != "apiKeyValue" { msg := fmt.Sprintf("unauthorized user") sendErrorResponse(http.StatusUnauthorized, msg, w) return errors.New(msg)