Add support for external references #2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
External references will be encapsulated in a package as described by the
--extrefs argument.
Automatically adds import paths to appropriate generated files.
Insecure get of remote refs
Gen code with external refs works
Enable use of go-decode for "oneOf" structs that have discriptors
For replies that don't have types via ref's don't use decode.Decodeable
Added tests for the decodable oneOf stuff for both refs and non-refs
Use the enum for the type that is the discriptor for the mapping
between types.
Remove the references to the hidden fork for now
Remove the decodable type
used for discrimination as it is useful to have.
Added pre-loading of remote schemas to 'automatically' generate mappings of useful, common schemas to their go types and imports.
Changed to parse out user specified package name
Changed to parse out user specified package name
Changed to parse out user specified package name in tpe import
clean references to gitlab packages
refactor typeMap to be a map of TypeImportSpec - a 3-tuple of type, package, import path
templates are simple again
Added a couple of tests
removed replace statements
added support for local(nested) oneOf - required adding mapping between a path and a discriminator
added generation of implementaion of DecoderDesc interface defined in go-decode
moved test strings to files in testdata directory
added tests for nested oneOf
Added to template context object - required due to support for local/nested oneOf
Added to Decorator object for the same reasons
Added utility function
missed change from master
Added pre-loading of remote schemas to 'automatically' generate mappings of useful, common schemas to their go types and imports.
changed to use function factories
added some missing checks to schema processing of oneOf
Support multi-level inheritance of common refs
Some spec files that have interitance may not have paths.
Fix external refs that have external refs
The remote load of the external ref needs to have allowRefs passed do it
so that load doesn't bomb when it loads the ref.
Fixed schema processing in case of reference types
Now generating error if a oneOf is defined inside an anonymous schema
added more complex schemas to ensure no regression
Use local fork of kin-openapi -- DO NOT MERGE UPSTREAM
Added pre-loading of remote schemas to 'automatically' generate mappings of useful, common schemas to their go types and imports.
Changed to parse out user specified package name in tpe import
rebase with master
Fix for seg fault while processing oneOf
bugfix/ind-3231: added code that detemines whether a discriminator property is defined as a required property and generates the correct constructor as a result
Test found under internal/test/issues/issue-f5-3231
introduce context, change template functions to use context
This is a first step on a bigger refactoring effort that will make use of the provided parse tree as it were
updated to use our fork of kin-openapi in github
feature: updated to use our fork of kin-openapi in github
restored old TypeFactory to satisfy old decode.Decode calls
fixed regression in go.mod - pointing to kin-openapi 0.2.2
fix: Update go.mod with a kin-openapi that merges remote refs
Addresses bug https://nginxsoftware.atlassian.net/browse/IND-3824
fix: don't overwrite the mappings for import package refs
import packages must be specified in most general -> least general for this to work
Move to the Metadata build
Parent struct generates child oneOf decorators
changed to point to kin-openapi 0.2.5 and using the functionality there
changed inline.tmpl to provide a function that returns the JSON schema as a string
tests are incoming
added code to generate struct tags containing property's default value when specified in schema
re-added test to ensure defaults are not generated for array types
fixed a bug related to resolved-spec - generating operation definitions is not necessary when doing that
When processing a highly nested schema with oneOf this triggers a failure, but since there's no code being generated, this is not needed
Fix Embedd spec arg restrictions
fix: generate client with interface for HTTPClient
fix: Update client interface helper function, update internal test code
fix: add generate target
According to https://github.com/deepmap/oapi-codegen,
"When you update any of the files under the templates/ directory,
you will need to regenerate the template inlines:
go generate ./pkg/codegen/templates
All this command does is inline the files ending in .tmpl into
the specified Go file. Afterwards you should run:
go generate ./...
and the templates will be updated accordingly."
Without running go generate twice, the files may not be updated,
resulting in the unit tests running against generated files that
don't contain the most recent changes.
The code generation has been moved to a separate target that
also runs goimports -w.
.gitignore has been updated to include the test output files.
fix: escape/unescape path and query params
The runtime library has been updated to escape path and query
parameters in the client code and unescape the parameters in
the server code.
Since these are the first changes made to the runtime library,
the generator has been updated to use the forked copy of the
runtime package instead of the original 1.3.0 tagged version.