From f99133d04829d16a5ca62277b6debf11d35cc2f5 Mon Sep 17 00:00:00 2001 From: haitham911 Date: Mon, 28 Oct 2024 09:17:46 +0300 Subject: [PATCH] Refactor file_utils.go and json-schema.mdx --- pkg/utils/file_utils.go | 5 ++++- website/docs/core-concepts/validate/json-schema.mdx | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pkg/utils/file_utils.go b/pkg/utils/file_utils.go index 4b4ee0f3e..4c0d752a1 100644 --- a/pkg/utils/file_utils.go +++ b/pkg/utils/file_utils.go @@ -198,6 +198,9 @@ func SearchConfigFile(path string) (string, bool) { // IsURL checks if a string is a URL func IsURL(s string) bool { url, err := url.Parse(s) + if err != nil { + return false + } validSchemes := []string{"http", "https"} schemeValid := false for _, scheme := range validSchemes { @@ -206,7 +209,7 @@ func IsURL(s string) bool { break } } - return err == nil && schemeValid + return schemeValid } diff --git a/website/docs/core-concepts/validate/json-schema.mdx b/website/docs/core-concepts/validate/json-schema.mdx index 0f5b76468..850ba953b 100644 --- a/website/docs/core-concepts/validate/json-schema.mdx +++ b/website/docs/core-concepts/validate/json-schema.mdx @@ -42,7 +42,7 @@ schemas: In the component [manifest](https://github.com/cloudposse/atmos/blob/master/examples/quick-start-advanced/stacks/catalog/vpc/defaults.yaml), add the `settings.validation` section: -### Specify Remote Schemas +### Use Remote Schemas You can specify remote schemas by setting the `manifest` field to a remote URL in your `atmos.yaml` configuration file. ```yaml