-
Notifications
You must be signed in to change notification settings - Fork 209
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Complete helper function(s) for creating/updating/deleting "Blank" API endpoints #55
Comments
Porges
added a commit
that referenced
this issue
May 11, 2021
* wip: walk the deployment schema to harvest types and version * wip generator to create crds * Change references to ToPackages() ToNodes() Fixing a few broken references. * Ast improvements (#47) * Fix comment handling to avoid panic * Define interface AstGenerator * Create FieldDefinition struct and test * Create StructDefinition and test * Factor out loadSchema() * Introduce SchemaScanner * Change field factory methods to return FieldDefinition * Improve logging in root.go * Make description optional for FieldDefinition * Modify getFields to return FieldDefinitions * Relocate TypeHandlers to SchemaScanner * Add fileDefinition and use to export structs * Add tests for FileDefinition * Move filters onto SchemaScanner * Introduce ScannerTopic and plumb through * Makes structs versioned * fixup! Introduce ScannerTopic and plumb through * Generate structs into different namespaces by version * Use new interface "Definition" when walking schema tree * Split method into two better focused methods * Suppress field comments if empty * Enforce field names and types being present Also includes passing ScannerTopic when creating simple fields * Fix failing tests * Remove duplicate declaration * include number of structs written in output message * Fix detection of version numbers in schema URLs * Add gitignore * Switch to log package * Fix doc-comments (somewhat) * Fix println with format specifier * Remove AstGenerator interface Modify tests to check for the Definition interface instead * Remove use of panic() * Remove redundant initialization * Fix test compilation error * Return errors from `objectTypeOf()` and `versionOf()` Co-authored-by: George Pollard <gpollard@microsoft.com> * Further improvements to AST generation (#52) * Start code gen from root rather than root/resources * Remove possibility of failure from ToAst() There's no reason for this to fail, and it complicates the code. * Add Type interface to go with Definition * Flesh out types and update JSONAST to use them * Alter JSONAST so handlers return Types instead of Definitions * Add description to root type * Always use ref URL to generate new topic names * Document nil return for TypeHandler This is valid (see, e.g. RefHandler). * Reorder code to simplify * Make TypeHandler take scanner explicitly * Remove use of ScannerTopic which isn't needed any more * Hide fields in StructType * Simplify NewSchemaScanner * Factor out fixedTypeHandler * Fix nomenclature to match Go * Reduce nesting in allOfHandler * Create an IdentifierFactory to create valid Go identifiers (#53) * Create IdentifierFactory and test * Hook up use of IdentifierFactory * Code gardening * Use gomega instead of testify * Use idiomatic Go approach for test cases * Tidy go.mod * Rename local to idFactory * Enforce interface implementation w/compiler * Remove scannerTopic.go Test coverage increases by 1%! * Add copyright headers (#59) * Code Gardening (#58) * Add missing comments on public declarations * Whitespaces changes by go fmt * Preserve immutability by returning a copy of the slice * Remove else after return * Add missing header copyright comments * Fix compilation issues in branch * Make test pass * Add support for additionalProperties schema (#55) * Add support for additionalProperties schema This lets us generate types like this for tags members: ```go Tags map[string]string ``` * Add golden-files test infrastructure and tests This will add coverage for 'additionalProperties'. * Simplify runGoldenTest file reading * Run * Merge 'schema' Co-authored-by: Dave Fellows <dave.fellows@microsoft.com> Co-authored-by: Bevan Arps <bevan.arps@outlook.com> Co-authored-by: George Pollard <gpollard@microsoft.com> Co-authored-by: Bevan Arps <bevan.arps@microsoft.com>
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
#24
Complete the helper methods so that a "blank" api endpoint can be created / updated / deleted.
This should involve the creation of unit tests for the functionality.
The text was updated successfully, but these errors were encountered: