Register the path directive by default, but it only supports encoding function. For a complete path directive, users still need to use the integration subpackage:
Include encoding functionality to this package. From now on, httpin doesn't only support decoding an HTTP request to a Go struct, it supports encoding a Go struct to an HTTP request as well. Simply call httpin.NewRequest method. Because all the builtin directives now support encoding functions.
Introduced a new directive named nonzero. Which is used to cover/correct miss-use of the required directive, use nonzero instead of required to ensure that the field not be a zero/empty value.
For custom struct types, you don't need to register it to httpin any more, as long as you implement the Stringable interface.
Breaking Changes
Less APIs are exposed under package httpin. I hope the list will be limited to the following, which I would like to keep in the first stable release (v1.0.0):
httpin.New: creates a core.Core instance;
httpin.NewInput: creates a HTTP middleware;
httpin.Input: the context key to retrieve the decoded struct instance that was injected to http.Request.Context by httpin;
httpin.Decode: decode an HTTP request to a struct instance;
httpin.NewRequest: encode a struct instance to an HTTP request;
httpin.NewRequestWithContext: call httpin.NewRequest with a context.Context;
httpin.File: the type for manipulating file uploading in httpin;
httpin.UploadFile: upload file by filename;
httpin.UploadStream: upload file by stream.
APIs to integrate with third-party packages are moved to the integration subpackage:
... (truncated)
Commits
63aead2 feat: httpin.Option, add parameter opts to New,Decode,Encode
af34b7c Merge pull request #93 from alecsammon/owl_error
You can trigger a rebase of this PR by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Note
Automatic rebases have been disabled on this pull request as it has been open for over 30 days.
Bumps github.com/ggicci/httpin from 0.14.2 to 0.16.0.
Release notes
Sourced from github.com/ggicci/httpin's releases.
... (truncated)
Commits
63aead2
feat: httpin.Option, add parameter opts to New,Decode,Encodeaf34b7c
Merge pull request #93 from alecsammon/owl_errore6be2b3
* alias error to git error7bb92b1
Use owl.ErrUnsupportedType to allow detecting type of error5dca4c8
Merge pull request #92 from ggicci/fix/88-streamingd7c8134
fix: issue 88, streamingfbcb1f2
Merge pull request #91 from alecsammon/unknown_body_type_error1b09f0b
Add custom ErrUnknownBodyFormat5d958eb
Merge pull request #82 from ggicci/dependabot/github_actions/actions/setup-go-540647db
feat: register path directive by default, but support encoding onlyYou can trigger a rebase of this PR by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show