Repository: ogen-go/ogen
Pull request #1127 (2023-12-06 05:36:14)

refactor: export jsonpointer, location packages

codecov[bot]: ## [Codecov](https://app.codecov.io/gh/ogen-go/ogen/pull/1127?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ogen-go) Report
All modified and coverable lines are covered by tests :white_check_mark:
> Comparison is base [(`7b0e4b0`)](https://app.codecov.io/gh/ogen-go/ogen/commit/7b0e4b086b3c418a9b8a147af9e201a9999db50a?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ogen-go) 72.40% compared to head [(`27bec45`)](https://app.codecov.io/gh/ogen-go/ogen/pull/1127?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ogen-go) 72.39%.
> Report is 33 commits behind head on main.


<details><summary>Additional details and impacted files</summary>


```diff
@@            Coverage Diff             @@
##             main    #1127      +/-   ##
==========================================
- Coverage   72.40%   72.39%   -0.01%     
==========================================
  Files         187      187              
  Lines       14955    14996      +41     
==========================================
+ Hits        10828    10857      +29     
- Misses       3595     3607      +12     
  Partials      532      532              
```



</details>

[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/ogen-go/ogen/pull/1127?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ogen-go).   
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ogen-go).


Patch:
diff --git a/cmd/jschemagen/main.go b/cmd/jschemagen/main.go
index 759fbc62..a7455a0a 100644
--- a/cmd/jschemagen/main.go
+++ b/cmd/jschemagen/main.go
@@ -13,9 +13,9 @@ import (
 
 	"github.com/ogen-go/ogen/gen"
 	"github.com/ogen-go/ogen/gen/genfs"
-	"github.com/ogen-go/ogen/internal/jsonpointer"
 	"github.com/ogen-go/ogen/internal/ogenzap"
 	"github.com/ogen-go/ogen/internal/urlpath"
+	"github.com/ogen-go/ogen/jsonpointer"
 	"github.com/ogen-go/ogen/jsonschema"
 )
 
diff --git a/cmd/ogen/main.go b/cmd/ogen/main.go
index a5a31ff4..e2a2586b 100644
--- a/cmd/ogen/main.go
+++ b/cmd/ogen/main.go
@@ -21,9 +21,9 @@ import (
 	"github.com/ogen-go/ogen"
 	"github.com/ogen-go/ogen/gen"
 	"github.com/ogen-go/ogen/gen/genfs"
-	"github.com/ogen-go/ogen/internal/location"
 	"github.com/ogen-go/ogen/internal/ogenversion"
 	"github.com/ogen-go/ogen/internal/ogenzap"
+	"github.com/ogen-go/ogen/location"
 )
 
 func cleanDir(targetDir string, files []os.DirEntry) (rerr error) {
diff --git a/gen/options.go b/gen/options.go
index 66e1bc14..cdf4b931 100644
--- a/gen/options.go
+++ b/gen/options.go
@@ -16,9 +16,9 @@ import (
 	"golang.org/x/exp/slices"
 
 	"github.com/ogen-go/ogen/gen/ir"
-	"github.com/ogen-go/ogen/internal/location"
 	"github.com/ogen-go/ogen/internal/urlpath"
 	"github.com/ogen-go/ogen/jsonschema"
+	"github.com/ogen-go/ogen/location"
 	"github.com/ogen-go/ogen/openapi"
 )
 
diff --git a/gen/reduce.go b/gen/reduce.go
index ef940a3a..55711748 100644
--- a/gen/reduce.go
+++ b/gen/reduce.go
@@ -7,8 +7,8 @@ import (
 	"go.uber.org/zap"
 
 	"github.com/ogen-go/ogen/gen/ir"
-	"github.com/ogen-go/ogen/internal/location"
 	ogenjson "github.com/ogen-go/ogen/json"
+	"github.com/ogen-go/ogen/location"
 	"github.com/ogen-go/ogen/openapi"
 )
 
diff --git a/gen/schema_gen.go b/gen/schema_gen.go
index e4ea2bf3..263164eb 100644
--- a/gen/schema_gen.go
+++ b/gen/schema_gen.go
@@ -8,9 +8,9 @@ import (
 	"go.uber.org/zap"
 
 	"github.com/ogen-go/ogen/gen/ir"
-	"github.com/ogen-go/ogen/internal/location"
 	"github.com/ogen-go/ogen/internal/naming"
 	"github.com/ogen-go/ogen/jsonschema"
+	"github.com/ogen-go/ogen/location"
 )
 
 type refNamer func(ref jsonschema.Ref) (string, error)
diff --git a/gen/schema_gen_sum.go b/gen/schema_gen_sum.go
index 440ef50b..083952c2 100644
--- a/gen/schema_gen_sum.go
+++ b/gen/schema_gen_sum.go
@@ -12,10 +12,10 @@ import (
 	"golang.org/x/exp/slices"
 
 	"github.com/ogen-go/ogen/gen/ir"
-	"github.com/ogen-go/ogen/internal/location"
 	"github.com/ogen-go/ogen/internal/xmaps"
 	"github.com/ogen-go/ogen/internal/xslices"
 	"github.com/ogen-go/ogen/jsonschema"
+	"github.com/ogen-go/ogen/location"
 )
 
 func canUseTypeDiscriminator(sum []*ir.Type, isOneOf bool) bool {
diff --git a/gen/utils.go b/gen/utils.go
index 274c0375..1e2e70c7 100644
--- a/gen/utils.go
+++ b/gen/utils.go
@@ -7,8 +7,8 @@ import (
 	"go.uber.org/zap"
 
 	"github.com/ogen-go/ogen/gen/ir"
-	"github.com/ogen-go/ogen/internal/location"
 	"github.com/ogen-go/ogen/jsonschema"
+	"github.com/ogen-go/ogen/location"
 )
 
 func unreachable(v any) string {
diff --git a/internal/jsonpointer/errors.go b/jsonpointer/errors.go
similarity index 100%
rename from internal/jsonpointer/errors.go
rename to jsonpointer/errors.go
diff --git a/internal/jsonpointer/errors_test.go b/jsonpointer/errors_test.go
similarity index 100%
rename from internal/jsonpointer/errors_test.go
rename to jsonpointer/errors_test.go
diff --git a/internal/jsonpointer/jsonpointer.go b/jsonpointer/jsonpointer.go
similarity index 100%
rename from internal/jsonpointer/jsonpointer.go
rename to jsonpointer/jsonpointer.go
diff --git a/internal/jsonpointer/jsonpointer_test.go b/jsonpointer/jsonpointer_test.go
similarity index 100%
rename from internal/jsonpointer/jsonpointer_test.go
rename to jsonpointer/jsonpointer_test.go
diff --git a/internal/jsonpointer/resolve_ctx.go b/jsonpointer/resolve_ctx.go
similarity index 98%
rename from internal/jsonpointer/resolve_ctx.go
rename to jsonpointer/resolve_ctx.go
index 1ceac40c..f0aaed3c 100644
--- a/internal/jsonpointer/resolve_ctx.go
+++ b/jsonpointer/resolve_ctx.go
@@ -6,7 +6,7 @@ import (
 
 	"github.com/go-faster/errors"
 
-	"github.com/ogen-go/ogen/internal/location"
+	"github.com/ogen-go/ogen/location"
 )
 
 // RefKey is JSON Reference key.
diff --git a/internal/jsonpointer/split.go b/jsonpointer/split.go
similarity index 100%
rename from internal/jsonpointer/split.go
rename to jsonpointer/split.go
diff --git a/jsonschema/errors.go b/jsonschema/errors.go
index 6269a7a3..a4ad1f4c 100644
--- a/jsonschema/errors.go
+++ b/jsonschema/errors.go
@@ -3,8 +3,8 @@ package jsonschema
 import (
 	"github.com/go-faster/errors"
 
-	"github.com/ogen-go/ogen/internal/jsonpointer"
-	"github.com/ogen-go/ogen/internal/location"
+	"github.com/ogen-go/ogen/jsonpointer"
+	"github.com/ogen-go/ogen/location"
 )
 
 // LocationError is a wrapper for an error that has a location.
diff --git a/jsonschema/extensions.go b/jsonschema/extensions.go
index 9fe60b31..783400ff 100644
--- a/jsonschema/extensions.go
+++ b/jsonschema/extensions.go
@@ -9,7 +9,7 @@ import (
 	"github.com/go-faster/jx"
 	"github.com/go-faster/yaml"
 
-	"github.com/ogen-go/ogen/internal/location"
+	"github.com/ogen-go/ogen/location"
 )
 
 // Extensions map is "^x-" fields list.
diff --git a/jsonschema/parser.go b/jsonschema/parser.go
index 751b1ff0..246e614f 100644
--- a/jsonschema/parser.go
+++ b/jsonschema/parser.go
@@ -11,9 +11,9 @@ import (
 	"github.com/go-faster/errors"
 	"golang.org/x/exp/slices"
 
-	"github.com/ogen-go/ogen/internal/jsonpointer"
-	"github.com/ogen-go/ogen/internal/location"
 	ogenjson "github.com/ogen-go/ogen/json"
+	"github.com/ogen-go/ogen/jsonpointer"
+	"github.com/ogen-go/ogen/location"
 	"github.com/ogen-go/ogen/ogenregex"
 )
 
diff --git a/jsonschema/parser_settings.go b/jsonschema/parser_settings.go
index 299305ef..b74a688a 100644
--- a/jsonschema/parser_settings.go
+++ b/jsonschema/parser_settings.go
@@ -3,7 +3,7 @@ package jsonschema
 import (
 	"errors"
 
-	"github.com/ogen-go/ogen/internal/location"
+	"github.com/ogen-go/ogen/location"
 )
 
 // Settings is parser settings.
diff --git a/jsonschema/resolve.go b/jsonschema/resolve.go
index fffaa597..863cbfef 100644
--- a/jsonschema/resolve.go
+++ b/jsonschema/resolve.go
@@ -6,8 +6,8 @@ import (
 	"github.com/go-faster/errors"
 	"github.com/go-faster/yaml"
 
-	"github.com/ogen-go/ogen/internal/jsonpointer"
-	"github.com/ogen-go/ogen/internal/location"
+	"github.com/ogen-go/ogen/jsonpointer"
+	"github.com/ogen-go/ogen/location"
 )
 
 // ReferenceResolver resolves JSON schema references.
diff --git a/jsonschema/resolver.go b/jsonschema/resolver.go
index a8492ce9..37937777 100644
--- a/jsonschema/resolver.go
+++ b/jsonschema/resolver.go
@@ -6,7 +6,7 @@ import (
 	"github.com/go-faster/errors"
 	"github.com/go-faster/yaml"
 
-	"github.com/ogen-go/ogen/internal/jsonpointer"
+	"github.com/ogen-go/ogen/jsonpointer"
 )
 
 // RootResolver is ReferenceResolver implementation.
diff --git a/jsonschema/schema.go b/jsonschema/schema.go
index fc287c75..046c48ff 100644
--- a/jsonschema/schema.go
+++ b/jsonschema/schema.go
@@ -1,8 +1,8 @@
 package jsonschema
 
 import (
-	"github.com/ogen-go/ogen/internal/jsonpointer"
-	"github.com/ogen-go/ogen/internal/location"
+	"github.com/ogen-go/ogen/jsonpointer"
+	"github.com/ogen-go/ogen/location"
 	"github.com/ogen-go/ogen/ogenregex"
 )
 
diff --git a/openapi/api.go b/openapi/api.go
index 76209e5a..5b237a09 100644
--- a/openapi/api.go
+++ b/openapi/api.go
@@ -2,7 +2,7 @@
 package openapi
 
 import (
-	"github.com/ogen-go/ogen/internal/jsonpointer"
+	"github.com/ogen-go/ogen/jsonpointer"
 	"github.com/ogen-go/ogen/jsonschema"
 )
 
diff --git a/openapi/example.go b/openapi/example.go
index 2d055b24..e202909c 100644
--- a/openapi/example.go
+++ b/openapi/example.go
@@ -1,8 +1,8 @@
 package openapi
 
 import (
-	"github.com/ogen-go/ogen/internal/location"
 	"github.com/ogen-go/ogen/jsonschema"
+	"github.com/ogen-go/ogen/location"
 )
 
 // Example is an OpenAPI Example.
diff --git a/openapi/mediatype.go b/openapi/mediatype.go
index 4cbdf4ac..53b34ad0 100644
--- a/openapi/mediatype.go
+++ b/openapi/mediatype.go
@@ -3,8 +3,8 @@ package openapi
 import (
 	"encoding/json"
 
-	"github.com/ogen-go/ogen/internal/location"
 	"github.com/ogen-go/ogen/jsonschema"
+	"github.com/ogen-go/ogen/location"
 )
 
 // MediaType is Media Type Object.
diff --git a/openapi/operation.go b/openapi/operation.go
index 6123aa91..5e8fbf8b 100644
--- a/openapi/operation.go
+++ b/openapi/operation.go
@@ -5,7 +5,7 @@ import (
 
 	"github.com/go-faster/errors"
 
-	"github.com/ogen-go/ogen/internal/location"
+	"github.com/ogen-go/ogen/location"
 )
 
 // Operation is an OpenAPI Operation.
diff --git a/openapi/parameter.go b/openapi/parameter.go
index f7a439da..dad6f613 100644
--- a/openapi/parameter.go
+++ b/openapi/parameter.go
@@ -1,8 +1,8 @@
 package openapi
 
 import (
-	"github.com/ogen-go/ogen/internal/location"
 	"github.com/ogen-go/ogen/jsonschema"
+	"github.com/ogen-go/ogen/location"
 )
 
 // ParameterLocation defines where OpenAPI parameter is located.
diff --git a/openapi/parser/errors.go b/openapi/parser/errors.go
index aafca650..42f5bcf3 100644
--- a/openapi/parser/errors.go
+++ b/openapi/parser/errors.go
@@ -3,8 +3,8 @@ package parser
 import (
 	"github.com/go-faster/errors"
 
-	"github.com/ogen-go/ogen/internal/jsonpointer"
-	"github.com/ogen-go/ogen/internal/location"
+	"github.com/ogen-go/ogen/jsonpointer"
+	"github.com/ogen-go/ogen/location"
 )
 
 // LocationError is a wrapper for an error that has a location.
diff --git a/openapi/parser/expand.go b/openapi/parser/expand.go
index 603f3f7f..b858e059 100644
--- a/openapi/parser/expand.go
+++ b/openapi/parser/expand.go
@@ -9,8 +9,8 @@ import (
 	"github.com/go-faster/errors"
 
 	"github.com/ogen-go/ogen"
-	"github.com/ogen-go/ogen/internal/location"
 	"github.com/ogen-go/ogen/jsonschema"
+	"github.com/ogen-go/ogen/location"
 	"github.com/ogen-go/ogen/openapi"
 )
 
diff --git a/openapi/parser/parse_components.go b/openapi/parser/parse_components.go
index 1c1aa212..1f9aff56 100644
--- a/openapi/parser/parse_components.go
+++ b/openapi/parser/parse_components.go
@@ -6,8 +6,8 @@ import (
 	"github.com/go-faster/errors"
 
 	"github.com/ogen-go/ogen"
-	"github.com/ogen-go/ogen/internal/location"
 	"github.com/ogen-go/ogen/jsonschema"
+	"github.com/ogen-go/ogen/location"
 	"github.com/ogen-go/ogen/openapi"
 )
 
diff --git a/openapi/parser/parse_example.go b/openapi/parser/parse_example.go
index aa8dcfae..40d4d8c4 100644
--- a/openapi/parser/parse_example.go
+++ b/openapi/parser/parse_example.go
@@ -2,7 +2,7 @@ package parser
 
 import (
 	"github.com/ogen-go/ogen"
-	"github.com/ogen-go/ogen/internal/jsonpointer"
+	"github.com/ogen-go/ogen/jsonpointer"
 	"github.com/ogen-go/ogen/openapi"
 )
 
diff --git a/openapi/parser/parse_header.go b/openapi/parser/parse_header.go
index 9ceab721..bad1d9c0 100644
--- a/openapi/parser/parse_header.go
+++ b/openapi/parser/parse_header.go
@@ -6,8 +6,8 @@ import (
 	"github.com/go-faster/errors"
 
 	"github.com/ogen-go/ogen"
-	"github.com/ogen-go/ogen/internal/jsonpointer"
-	"github.com/ogen-go/ogen/internal/location"
+	"github.com/ogen-go/ogen/jsonpointer"
+	"github.com/ogen-go/ogen/location"
 	"github.com/ogen-go/ogen/openapi"
 )
 
diff --git a/openapi/parser/parse_mediatype.go b/openapi/parser/parse_mediatype.go
index 1d8ea11f..8950bb27 100644
--- a/openapi/parser/parse_mediatype.go
+++ b/openapi/parser/parse_mediatype.go
@@ -7,9 +7,9 @@ import (
 	"github.com/go-faster/errors"
 
 	"github.com/ogen-go/ogen"
-	"github.com/ogen-go/ogen/internal/jsonpointer"
-	"github.com/ogen-go/ogen/internal/location"
+	"github.com/ogen-go/ogen/jsonpointer"
 	"github.com/ogen-go/ogen/jsonschema"
+	"github.com/ogen-go/ogen/location"
 	"github.com/ogen-go/ogen/openapi"
 )
 
diff --git a/openapi/parser/parse_parameter.go b/openapi/parser/parse_parameter.go
index 5c1d6da4..d6186a28 100644
--- a/openapi/parser/parse_parameter.go
+++ b/openapi/parser/parse_parameter.go
@@ -10,9 +10,9 @@ import (
 
 	"github.com/ogen-go/ogen"
 	"github.com/ogen-go/ogen/internal/httpcookie"
-	"github.com/ogen-go/ogen/internal/jsonpointer"
-	"github.com/ogen-go/ogen/internal/location"
+	"github.com/ogen-go/ogen/jsonpointer"
 	"github.com/ogen-go/ogen/jsonschema"
+	"github.com/ogen-go/ogen/location"
 	"github.com/ogen-go/ogen/openapi"
 )
 
diff --git a/openapi/parser/parse_path_item.go b/openapi/parser/parse_path_item.go
index 4345fbba..4a28f380 100644
--- a/openapi/parser/parse_path_item.go
+++ b/openapi/parser/parse_path_item.go
@@ -6,8 +6,8 @@ import (
 	"github.com/go-faster/errors"
 
 	"github.com/ogen-go/ogen"
-	"github.com/ogen-go/ogen/internal/jsonpointer"
-	"github.com/ogen-go/ogen/internal/location"
+	"github.com/ogen-go/ogen/jsonpointer"
+	"github.com/ogen-go/ogen/location"
 	"github.com/ogen-go/ogen/openapi"
 )
 
diff --git a/openapi/parser/parse_request_body.go b/openapi/parser/parse_request_body.go
index ecf0d9a7..ae14370f 100644
--- a/openapi/parser/parse_request_body.go
+++ b/openapi/parser/parse_request_body.go
@@ -4,7 +4,7 @@ import (
 	"github.com/go-faster/errors"
 
 	"github.com/ogen-go/ogen"
-	"github.com/ogen-go/ogen/internal/jsonpointer"
+	"github.com/ogen-go/ogen/jsonpointer"
 	"github.com/ogen-go/ogen/openapi"
 )
 
diff --git a/openapi/parser/parse_response.go b/openapi/parser/parse_response.go
index 5930f896..0d2ef101 100644
--- a/openapi/parser/parse_response.go
+++ b/openapi/parser/parse_response.go
@@ -4,8 +4,8 @@ import (
 	"github.com/go-faster/errors"
 
 	"github.com/ogen-go/ogen"
-	"github.com/ogen-go/ogen/internal/jsonpointer"
-	"github.com/ogen-go/ogen/internal/location"
+	"github.com/ogen-go/ogen/jsonpointer"
+	"github.com/ogen-go/ogen/location"
 	"github.com/ogen-go/ogen/openapi"
 )
 
diff --git a/openapi/parser/parse_schema.go b/openapi/parser/parse_schema.go
index 3d91d4ef..b0f6132a 100644
--- a/openapi/parser/parse_schema.go
+++ b/openapi/parser/parse_schema.go
@@ -4,7 +4,7 @@ import (
 	"github.com/go-faster/errors"
 
 	"github.com/ogen-go/ogen"
-	"github.com/ogen-go/ogen/internal/jsonpointer"
+	"github.com/ogen-go/ogen/jsonpointer"
 	"github.com/ogen-go/ogen/jsonschema"
 )
 
diff --git a/openapi/parser/parse_security.go b/openapi/parser/parse_security.go
index dc31239d..15b68a52 100644
--- a/openapi/parser/parse_security.go
+++ b/openapi/parser/parse_security.go
@@ -8,9 +8,9 @@ import (
 	"golang.org/x/exp/maps"
 
 	"github.com/ogen-go/ogen"
-	"github.com/ogen-go/ogen/internal/jsonpointer"
-	"github.com/ogen-go/ogen/internal/location"
 	"github.com/ogen-go/ogen/internal/xmaps"
+	"github.com/ogen-go/ogen/jsonpointer"
+	"github.com/ogen-go/ogen/location"
 	"github.com/ogen-go/ogen/openapi"
 )
 
diff --git a/openapi/parser/parse_server.go b/openapi/parser/parse_server.go
index a743cb9f..a0e6771a 100644
--- a/openapi/parser/parse_server.go
+++ b/openapi/parser/parse_server.go
@@ -8,7 +8,7 @@ import (
 	"golang.org/x/exp/slices"
 
 	"github.com/ogen-go/ogen"
-	"github.com/ogen-go/ogen/internal/jsonpointer"
+	"github.com/ogen-go/ogen/jsonpointer"
 	"github.com/ogen-go/ogen/openapi"
 )
 
diff --git a/openapi/parser/parse_webhook.go b/openapi/parser/parse_webhook.go
index 89e32d7e..b44a9619 100644
--- a/openapi/parser/parse_webhook.go
+++ b/openapi/parser/parse_webhook.go
@@ -4,8 +4,8 @@ import (
 	"github.com/go-faster/errors"
 
 	"github.com/ogen-go/ogen"
-	"github.com/ogen-go/ogen/internal/jsonpointer"
 	"github.com/ogen-go/ogen/internal/xmaps"
+	"github.com/ogen-go/ogen/jsonpointer"
 	"github.com/ogen-go/ogen/openapi"
 )
 
diff --git a/openapi/parser/parser.go b/openapi/parser/parser.go
index e5635731..95772b0f 100644
--- a/openapi/parser/parser.go
+++ b/openapi/parser/parser.go
@@ -9,10 +9,10 @@ import (
 	"golang.org/x/exp/maps"
 
 	"github.com/ogen-go/ogen"
-	"github.com/ogen-go/ogen/internal/jsonpointer"
-	"github.com/ogen-go/ogen/internal/location"
 	"github.com/ogen-go/ogen/internal/xmaps"
+	"github.com/ogen-go/ogen/jsonpointer"
 	"github.com/ogen-go/ogen/jsonschema"
+	"github.com/ogen-go/ogen/location"
 	"github.com/ogen-go/ogen/openapi"
 	"github.com/ogen-go/ogen/uri"
 )
diff --git a/openapi/parser/resolve.go b/openapi/parser/resolve.go
index 428d8c37..b18bc4c2 100644
--- a/openapi/parser/resolve.go
+++ b/openapi/parser/resolve.go
@@ -8,8 +8,8 @@ import (
 	"github.com/go-faster/yaml"
 
 	"github.com/ogen-go/ogen"
-	"github.com/ogen-go/ogen/internal/jsonpointer"
-	"github.com/ogen-go/ogen/internal/location"
+	"github.com/ogen-go/ogen/jsonpointer"
+	"github.com/ogen-go/ogen/location"
 	"github.com/ogen-go/ogen/openapi"
 )
 
diff --git a/openapi/parser/settings.go b/openapi/parser/settings.go
index c744bd41..e9749471 100644
--- a/openapi/parser/settings.go
+++ b/openapi/parser/settings.go
@@ -3,9 +3,9 @@ package parser
 import (
 	"net/url"
 
-	"github.com/ogen-go/ogen/internal/jsonpointer"
-	"github.com/ogen-go/ogen/internal/location"
+	"github.com/ogen-go/ogen/jsonpointer"
 	"github.com/ogen-go/ogen/jsonschema"
+	"github.com/ogen-go/ogen/location"
 )
 
 // Settings is parser settings.
diff --git a/openapi/security.go b/openapi/security.go
index e90ee873..b644fe29 100644
--- a/openapi/security.go
+++ b/openapi/security.go
@@ -1,6 +1,6 @@
 package openapi
 
-import "github.com/ogen-go/ogen/internal/location"
+import "github.com/ogen-go/ogen/location"
 
 // SecurityScheme defines one of security schemes used in the security requirement.
 type SecurityScheme struct {
diff --git a/openapi/webhook.go b/openapi/webhook.go
index f12038db..807dfdd6 100644
--- a/openapi/webhook.go
+++ b/openapi/webhook.go
@@ -1,6 +1,6 @@
 package openapi
 
-import "github.com/ogen-go/ogen/internal/location"
+import "github.com/ogen-go/ogen/location"
 
 // Webhook is an OpenAPI Webhook.
 type Webhook struct {
diff --git a/spec.go b/spec.go
index 4229eb80..869e8c47 100644
--- a/spec.go
+++ b/spec.go
@@ -5,8 +5,8 @@ import (
 
 	"github.com/go-faster/yaml"
 
-	"github.com/ogen-go/ogen/internal/location"
 	"github.com/ogen-go/ogen/jsonschema"
+	"github.com/ogen-go/ogen/location"
 )
 
 type (
diff --git a/tools/sgcollector/worker.go b/tools/sgcollector/worker.go
index 373ce1a9..773f3da3 100644
--- a/tools/sgcollector/worker.go
+++ b/tools/sgcollector/worker.go
@@ -17,7 +17,7 @@ import (
 
 	"github.com/ogen-go/ogen"
 	"github.com/ogen-go/ogen/gen"
-	"github.com/ogen-go/ogen/internal/location"
+	"github.com/ogen-go/ogen/location"
 )
 
 var errPanic = errors.New("panic")


Test patch:
diff --git a/gen/gen_schema_test.go b/gen/gen_schema_test.go
index 27abc5f9..f473ad24 100644
--- a/gen/gen_schema_test.go
+++ b/gen/gen_schema_test.go
@@ -14,7 +14,7 @@ import (
 	"go.uber.org/zap/zaptest"
 
 	"github.com/ogen-go/ogen/gen/genfs"
-	"github.com/ogen-go/ogen/internal/jsonpointer"
+	"github.com/ogen-go/ogen/jsonpointer"
 	"github.com/ogen-go/ogen/jsonschema"
 )
 
diff --git a/gen/schema_gen_test.go b/gen/schema_gen_test.go
index 260d2a8a..221a06e8 100644
--- a/gen/schema_gen_test.go
+++ b/gen/schema_gen_test.go
@@ -10,9 +10,9 @@ import (
 	"go.uber.org/zap/zaptest/observer"
 
 	"github.com/ogen-go/ogen/gen/ir"
-	"github.com/ogen-go/ogen/internal/jsonpointer"
-	"github.com/ogen-go/ogen/internal/location"
+	"github.com/ogen-go/ogen/jsonpointer"
 	"github.com/ogen-go/ogen/jsonschema"
+	"github.com/ogen-go/ogen/location"
 )
 
 func TestSchemaGenAnyWarn(t *testing.T) {
diff --git a/gen_test.go b/gen_test.go
index 4d8c993f..f0f90156 100644
--- a/gen_test.go
+++ b/gen_test.go
@@ -14,7 +14,7 @@ import (
 	"github.com/ogen-go/ogen/gen"
 	"github.com/ogen-go/ogen/gen/genfs"
 	"github.com/ogen-go/ogen/gen/ir"
-	"github.com/ogen-go/ogen/internal/location"
+	"github.com/ogen-go/ogen/location"
 	"github.com/ogen-go/ogen/openapi/parser"
 )
 
diff --git a/jsonschema/jsonschema_test.go b/jsonschema/jsonschema_test.go
index 027ec546..6c7588ff 100644
--- a/jsonschema/jsonschema_test.go
+++ b/jsonschema/jsonschema_test.go
@@ -10,10 +10,10 @@ import (
 	"github.com/go-faster/yaml"
 	"github.com/stretchr/testify/require"
 
-	"github.com/ogen-go/ogen/internal/jsonpointer"
-	"github.com/ogen-go/ogen/internal/location"
 	"github.com/ogen-go/ogen/internal/testutil"
+	"github.com/ogen-go/ogen/jsonpointer"
 	"github.com/ogen-go/ogen/jsonschema"
+	"github.com/ogen-go/ogen/location"
 )
 
 //go:embed _testdata
diff --git a/jsonschema/parser_test.go b/jsonschema/parser_test.go
index 8332b1c1..c13ce4c4 100644
--- a/jsonschema/parser_test.go
+++ b/jsonschema/parser_test.go
@@ -11,8 +11,8 @@ import (
 	"github.com/go-faster/yaml"
 	"github.com/stretchr/testify/require"
 
-	"github.com/ogen-go/ogen/internal/jsonpointer"
-	"github.com/ogen-go/ogen/internal/location"
+	"github.com/ogen-go/ogen/jsonpointer"
+	"github.com/ogen-go/ogen/location"
 )
 
 type components map[string]*RawSchema
diff --git a/jsonschema/resolve_test.go b/jsonschema/resolve_test.go
index 08c22594..e85a8e89 100644
--- a/jsonschema/resolve_test.go
+++ b/jsonschema/resolve_test.go
@@ -11,8 +11,8 @@ import (
 	"github.com/go-faster/jx"
 	"github.com/stretchr/testify/require"
 
-	"github.com/ogen-go/ogen/internal/jsonpointer"
-	"github.com/ogen-go/ogen/internal/location"
+	"github.com/ogen-go/ogen/jsonpointer"
+	"github.com/ogen-go/ogen/location"
 )
 
 type external map[string]components
diff --git a/internal/location/error.go b/location/error.go
similarity index 100%
rename from internal/location/error.go
rename to location/error.go
diff --git a/internal/location/error_test.go b/location/error_test.go
similarity index 100%
rename from internal/location/error_test.go
rename to location/error_test.go
diff --git a/internal/location/file.go b/location/file.go
similarity index 100%
rename from internal/location/file.go
rename to location/file.go
diff --git a/internal/location/lines.go b/location/lines.go
similarity index 100%
rename from internal/location/lines.go
rename to location/lines.go
diff --git a/internal/location/lines_test.go b/location/lines_test.go
similarity index 100%
rename from internal/location/lines_test.go
rename to location/lines_test.go
diff --git a/internal/location/location.go b/location/location.go
similarity index 100%
rename from internal/location/location.go
rename to location/location.go
diff --git a/internal/location/locator.go b/location/locator.go
similarity index 100%
rename from internal/location/locator.go
rename to location/locator.go
diff --git a/internal/location/position.go b/location/position.go
similarity index 100%
rename from internal/location/position.go
rename to location/position.go
diff --git a/internal/location/position_test.go b/location/position_test.go
similarity index 100%
rename from internal/location/position_test.go
rename to location/position_test.go
diff --git a/internal/location/print.go b/location/print.go
similarity index 100%
rename from internal/location/print.go
rename to location/print.go
diff --git a/location_test.go b/location_test.go
index a2c4fbea..b635e5a5 100644
--- a/location_test.go
+++ b/location_test.go
@@ -10,7 +10,7 @@ import (
 	"github.com/stretchr/testify/assert"
 	"github.com/stretchr/testify/require"
 
-	"github.com/ogen-go/ogen/internal/location"
+	"github.com/ogen-go/ogen/location"
 )
 
 func TestLocator(t *testing.T) {
diff --git a/openapi/parser/errors_test.go b/openapi/parser/errors_test.go
index 16e32acd..86039647 100644
--- a/openapi/parser/errors_test.go
+++ b/openapi/parser/errors_test.go
@@ -8,7 +8,7 @@ import (
 	"github.com/stretchr/testify/require"
 
 	"github.com/ogen-go/ogen"
-	"github.com/ogen-go/ogen/internal/location"
+	"github.com/ogen-go/ogen/location"
 )
 
 func TestRemoteLocation(t *testing.T) {
diff --git a/openapi/parser/parse_security_test.go b/openapi/parser/parse_security_test.go
index 2a905008..aa713c0f 100644
--- a/openapi/parser/parse_security_test.go
+++ b/openapi/parser/parse_security_test.go
@@ -7,7 +7,7 @@ import (
 	"github.com/stretchr/testify/require"
 
 	"github.com/ogen-go/ogen"
-	"github.com/ogen-go/ogen/internal/location"
+	"github.com/ogen-go/ogen/location"
 )
 
 func Test_validateOAuthFlows(t *testing.T) {
diff --git a/openapi/parser/parser_test.go b/openapi/parser/parser_test.go
index b782bac4..4500a3c8 100644
--- a/openapi/parser/parser_test.go
+++ b/openapi/parser/parser_test.go
@@ -14,10 +14,10 @@ import (
 	"github.com/stretchr/testify/require"
 
 	"github.com/ogen-go/ogen"
-	"github.com/ogen-go/ogen/internal/jsonpointer"
-	"github.com/ogen-go/ogen/internal/location"
 	"github.com/ogen-go/ogen/internal/testutil"
+	"github.com/ogen-go/ogen/jsonpointer"
 	"github.com/ogen-go/ogen/jsonschema"
+	"github.com/ogen-go/ogen/location"
 	"github.com/ogen-go/ogen/openapi"
 	"github.com/ogen-go/ogen/openapi/parser"
 )
diff --git a/openapi/parser/resolve_external_test.go b/openapi/parser/resolve_external_test.go
index 42bf4505..9cefc68b 100644
--- a/openapi/parser/resolve_external_test.go
+++ b/openapi/parser/resolve_external_test.go
@@ -18,8 +18,8 @@ import (
 	"github.com/stretchr/testify/require"
 
 	"github.com/ogen-go/ogen"
-	"github.com/ogen-go/ogen/internal/location"
 	"github.com/ogen-go/ogen/jsonschema"
+	"github.com/ogen-go/ogen/location"
 	"github.com/ogen-go/ogen/openapi"
 )