Skip to content

Custom liquid drop methods - #26

Closed
suleman-uzair wants to merge 11 commits into
mainfrom
update/liquid_drop_methods
Closed

Custom liquid drop methods#26
suleman-uzair wants to merge 11 commits into
mainfrom
update/liquid_drop_methods

Conversation

@suleman-uzair

Copy link
Copy Markdown
Member

This PR updates existing liquid drop methods, and documentation.

related to metanorma/metanorma-plugin-lutaml#251

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enhances the Liquid template integration by adding new liquid drop methods and comprehensive test coverage across XSD components. It also migrates from the xml-c14n gem to canon for XML canonicalization.

Key changes include:

  • Added sorting methods for schema elements, complex types, and attribute groups
  • Enhanced Base class with type checking predicates and cardinality methods
  • Added direct_child_elements, base_type, and referenced_object methods across various components
  • Created comprehensive test suites for all liquid method modules

Reviewed changes

Copilot reviewed 27 out of 27 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
lutaml-xsd.gemspec Added canon gem as runtime dependency (version 0.1.3)
Gemfile Removed canon and xml-c14n from development dependencies (now in gemspec)
spec/spec_helper.rb Updated to use canon gem instead of xml-c14n for XML formatting
spec/lutaml/xsd_spec.rb Refactored regex constants into reusable SCHEMA_ELEMENTS_REGEXES constant
lib/lutaml/xsd/base.rb Added type checking methods, cardinality methods, and safe navigation to resolved_element_order
lib/lutaml/xsd/schema.rb Added liquid methods for sorted access to elements, complex types, and attribute groups
lib/lutaml/xsd/simple_content.rb Added base_type liquid mapping
lib/lutaml/xsd/complex_type.rb Added direct_child_elements liquid mapping
lib/lutaml/xsd/liquid_methods/schema.rb New file implementing sorting methods for schema collections
lib/lutaml/xsd/liquid_methods/simple_content.rb Added base_type method to retrieve base from various sources
lib/lutaml/xsd/liquid_methods/sequence.rb Changed Xsd::Element to Element (introduces bug)
lib/lutaml/xsd/liquid_methods/group.rb Added referenced_object method and fixed child_elements to use referenced group
lib/lutaml/xsd/liquid_methods/element.rb Removed min_occurrences and max_occurrences (moved to Base), added safe navigation for attributes/child_elements
lib/lutaml/xsd/liquid_methods/complex_type.rb Added direct_child_elements method, changed flat_map to each for attribute accumulation
lib/lutaml/xsd/liquid_methods/attribute_group.rb Fixed referenced_object logic and added safe navigation to find_used_by
README.adoc Comprehensive documentation updates for new methods and reorganized Base class methods section
spec/lutaml/xsd/liquid_methods/*.rb Added 8 new comprehensive test files covering all liquid method modules
.rubocop_todo.yml Updated generated timestamp and BlockLength max from 30 to 108

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/lutaml/xsd/liquid_methods/sequence.rb Outdated
Comment thread lib/lutaml/xsd/liquid_methods/sequence.rb Outdated
Comment thread spec/lutaml/xsd/liquid_methods/choice_spec.rb Outdated
@suleman-uzair
suleman-uzair marked this pull request as ready for review December 11, 2025 12:40
@ronaldtse

Copy link
Copy Markdown
Contributor

We need to move this content to lutaml-model since XSD parsing functionality has moved there.

@suleman-uzair

Copy link
Copy Markdown
Member Author

We need to move this content to lutaml-model since XSD parsing functionality has moved there.

@ronaldtse, I’ve moved this functionality to lutaml/lutaml-model#626. I’ll let you know once it’s finalized.

@ronaldtse

Copy link
Copy Markdown
Contributor

Thanks @suleman-uzair !

@ronaldtse

Copy link
Copy Markdown
Contributor

We need to move this content to lutaml-model since XSD parsing functionality has moved there.

@ronaldtse, I’ve moved this functionality to lutaml/lutaml-model#626. I’ll let you know once it’s finalized.

lutaml/lutaml-model#626 is merged now, closing this. Thanks @suleman-uzair !

@ronaldtse ronaldtse closed this May 15, 2026
@ronaldtse
ronaldtse deleted the update/liquid_drop_methods branch May 15, 2026 03:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants