Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: export jsonpointer, location packages #1127

Merged
merged 1 commit into from
Dec 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/jschemagen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/ogen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion gen/gen_schema_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
2 changes: 1 addition & 1 deletion gen/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
2 changes: 1 addition & 1 deletion gen/reduce.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
2 changes: 1 addition & 1 deletion gen/schema_gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion gen/schema_gen_sum.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions gen/schema_gen_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion gen/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion gen_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions jsonschema/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion jsonschema/extensions.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions jsonschema/jsonschema_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions jsonschema/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
2 changes: 1 addition & 1 deletion jsonschema/parser_settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions jsonschema/parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions jsonschema/resolve.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions jsonschema/resolve_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion jsonschema/resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions jsonschema/schema.go
Original file line number Diff line number Diff line change
@@ -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"
)

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion location_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion openapi/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
2 changes: 1 addition & 1 deletion openapi/example.go
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion openapi/mediatype.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion openapi/operation.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion openapi/parameter.go
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
4 changes: 2 additions & 2 deletions openapi/parser/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion openapi/parser/errors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion openapi/parser/expand.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
2 changes: 1 addition & 1 deletion openapi/parser/parse_components.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
2 changes: 1 addition & 1 deletion openapi/parser/parse_example.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
4 changes: 2 additions & 2 deletions openapi/parser/parse_header.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
4 changes: 2 additions & 2 deletions openapi/parser/parse_mediatype.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
4 changes: 2 additions & 2 deletions openapi/parser/parse_parameter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
4 changes: 2 additions & 2 deletions openapi/parser/parse_path_item.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
2 changes: 1 addition & 1 deletion openapi/parser/parse_request_body.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
4 changes: 2 additions & 2 deletions openapi/parser/parse_response.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
Loading
Loading