Skip to content

fix: add Opaque to constImports for buggy MIBs#16

Closed
Jellyfrog wants to merge 1 commit into
lextudio:mainfrom
Jellyfrog:fix/opaque-const-imports
Closed

fix: add Opaque to constImports for buggy MIBs#16
Jellyfrog wants to merge 1 commit into
lextudio:mainfrom
Jellyfrog:fix/opaque-const-imports

Conversation

@Jellyfrog
Copy link
Copy Markdown

MIB files that use Opaque without importing it (e.g. JUNIPER-SMI which uses SYNTAX Opaque in its Integer64 TEXTUAL-CONVENTION) would fail with "Unknown parents for symbols" errors. Adding Opaque to the auto-imported symbols from SNMPv2-SMI fixes this, consistent with how other types like TimeTicks, Counter32, and Gauge32 are already handled.

Please note this code was generated by AI, but tested :)

MIB files that use Opaque without importing it (e.g. JUNIPER-SMI which
uses SYNTAX Opaque in its Integer64 TEXTUAL-CONVENTION) would fail with
"Unknown parents for symbols" errors. Adding Opaque to the auto-imported
symbols from SNMPv2-SMI fixes this, consistent with how other types like
TimeTicks, Counter32, and Gauge32 are already handled.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Jan 22, 2026

CLA assistant check
All committers have signed the CLA.

@lextm
Copy link
Copy Markdown

lextm commented Jan 22, 2026

You might need to disclose the revision of such MIB documents.

@Jellyfrog
Copy link
Copy Markdown
Author

@lextm
Copy link
Copy Markdown

lextm commented Jan 23, 2026

As Juniper is a major vendor and this JUNIPER-SMI document is at the core of its ecosystem, I think it makes sense to create a workaround. But I really dislike the constImports approach that leaves no clue of why an import was added and for which buggy document and revision. So, instead of expanding the list further, a new mechanism will be introduced.

@lextm lextm closed this Jan 23, 2026
@lextm
Copy link
Copy Markdown

lextm commented Jan 23, 2026

v1.6.3 ships the new mechanism, so you can use the following in your code to specify that you want Opaque to be imported for JUNIPER-SMI

implicit_imports.IMPLICIT_IMPORTS["JUNIPER-SMI"] = [("SNMPv2-SMI", "Opaque")]

@lextm lextm added the alternative design There are alternative designs to consider label Jan 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

alternative design There are alternative designs to consider

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants