Import/jsonname#141
Merged
Merged
Conversation
Follow-up on refactoring the swag API as more granular packages, and deprecating the vast API currently exposed by swag. All existing methods are maintained and work. Existing configuration using global vars will continue to work at the "swag" level: sub-packages no longer expose global variables. Smaller packages will help maintain this very diverse set of features. This API separates: * loading : file loading utilities * jsonutils, yamlutils: JSON & YAML document conversions Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
This clarifies the dependencies between the various utilities exposed by this package. Ultimately (not in this PR), we may convert some of the sub-packages into go modules, so as to isolate dependencies and allow users of some of the features not to be polluted by cross-dependencies. * refactored mangling to remove package state Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
This PR transforms the "swag" package into a mono repo, which exposes a collection of independant go modules. The objective is to reduce the footprint of required dependencies. To remain fully backward-compatible, the swag module imports all the newly created (sub) modules, for programs that consume its deprecated API. ci: ci automation, test coverage reporting and dependabot configuration have been adapted to support this new mono-repo structure. Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
Linting ------- * lint: updated linter config * lint; golangci-lint no longer digs into sub-modules: we have to run the action explicitly with "working-directory" * setup a matrix of submodules to lint all modules in this repo * lint: relinted code Auto-merging ------- * ci(auto-merge): the issue with golang.org updates auto-merge rule is caused by the name of the group "golang.org-dependencies" is internally rewritten as a slug name "golang-org-dependencies" (with a dash, not a dot) so this no longer matches the triggering rules. * ci(auto-merge): fixed the group name to replace "." by "-" (note: this fix should be propagated to all go-openapi repositories). Mono-repo settings ------- * hack: modified the tagging utility to support future modules declared at an arbitrary level in the hierarchy of folders. * ci: introduced a new job to identify all sub-modules and produces the corresponding matrix for linting & testing each one independently. * ci: introduced rendez-vous jobs for linting and testing so we can use only these two in branch protection rule requirements Signed-off-by: Frédéric BIDON <fredbi@yahoo.com>
We want to remove this dependency by default, while still providing support to users who want to use easyjson. * fixes go-openapi#68 This PR introduces an adapter to use ReadJSON and WriteJSON with different supporting libraries. By default only the standard library is enabled. A simple runtime registration allows the adapter to support easyjson. When import swag or swag/jsonutils or swag/yamlutils, easyjson is no longer a dependency: JSON serialization only requires the standard library. Supporting easyjson interfaces (e.g. for faster serialization) remains possible, by calling an independent module: swag/jsonutils/adapters/easyjson/json.Register(). 1. ordered map w/stdlib 2. registry with stdlib as default 3. fixed int vs float64 rendering 4. beefed up tests, including integration tests 5. honed doc 6. more tests TODO: * [x] hone test coverage * benchmarks * profiling Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
This PR prepares the forthcoming release. We need to tidy up a little bit the way the mono-repo setup is handled. This starts by embracing `go.work`. Content ======= * added go.work declaration * ci: adapted go tests to go.work. This should dramatically reduce the number of test jobs. At this moment, we still lint go modules in independent jobs. * ci: fixed issue with go mod caching * fix: dependabot not being able to update nested modules * updated stretchr/testify dependency (because dependabot didn't succeed doing so previously) * removed replace directives from top-level module. We still to keep the replace directives in sub-modules. These will disappear when we cut the next release. * doc (updated TODO items list) adapter tagger script to go.work Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
* switch to forked testify (go-openapi/testify/v2) which no longer imports external dependencies * all test dependencies now boil down to go-openapi/testify/v2 Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
This commit replaces the full license terms in each go source file by the more compact SPDX annotations (i.e. 2 lines instead of 13). All go files now embed these summarized licensing terms. Also: * license is now cited in README Aside: * fixed sample code in README on how to register an adapter Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
Signed-off-by: Oleksandr Redko <oleksandr.red+github@gmail.com>
Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
…ries with 2 updates Signed-off-by: dependabot[bot] <support@github.com>
…nventions for JSON (#195) Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
…ries with 2 updates Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #141 +/- ##
==========================================
- Coverage 89.43% 89.34% -0.10%
==========================================
Files 3 5 +2
Lines 388 591 +203
==========================================
+ Hits 347 528 +181
- Misses 24 38 +14
- Partials 17 25 +8 ☔ View full report in Codecov by Harness. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Change type
Please select: 🆕 New feature or enhancement|🔧 Bug fix'|📃 Documentation update
Short description
Fixes
Full description
Checklist