diff --git a/README.md b/README.md index 3078d5e..8044a65 100644 --- a/README.md +++ b/README.md @@ -34,13 +34,13 @@ openapi-compare -o new_oas.json -n old_oas.json -f Json ``` Available options: -| Option | Small | Required | Description | -|----------------|-------|----------|---------------------------------------------------------------------------------------------------------------| -| --old | -o | true | Path or URL to old OpenAPI Specification. | -| --new | -n | true | Path or URL to new OpenAPI Specification. | -| --outputFormat | -f | false | (Default: Json) Specifies in which format the differences should be displayed. Possible values: Json \| Text. | -| --strict | -s | false | (Default: false) Enable strict mode: breaking changes are errors instead of warnings. | -| --help | -h | false | Log available options | +| Option | Small | Required | Description | +|------------------|---------|----------|---------------------------------------------------------------------------------------------------------------------| +| `--old` | `-o` | `true` | Path or URL to old OpenAPI Specification. | +| `--new` | `-n` | `true` | Path or URL to new OpenAPI Specification. | +| `--outputFormat` | `-f` | `false` | (Default: `Json`) Specifies in which format the differences should be displayed. Possible values: `Json` \| `Text`. | +| `--strict` | `-s` | `false` | (Default: `false`) Enable strict mode: breaking changes are errors instead of warnings. | +| `--help` | `-h` | `false` | Log available options | ## Comparison rules diff --git a/src/Criteo.OpenApi.Comparator.Cli/Program.cs b/src/Criteo.OpenApi.Comparator.Cli/Program.cs index 60fa244..d9f978c 100644 --- a/src/Criteo.OpenApi.Comparator.Cli/Program.cs +++ b/src/Criteo.OpenApi.Comparator.Cli/Program.cs @@ -51,7 +51,9 @@ private static bool TryReadFile(string path, out string fileContent) { try { - var uri = new Uri(path); + // In case `path` is detected as an absolute or remote URI, `System.Uri` will ignore the `cwdUri`. + var cwdUri = new Uri(Directory.GetCurrentDirectory()); + var uri = new Uri(cwdUri, path); if (uri.IsFile) { return TryReadLocalFile(path, out fileContent);