feat: schema inference from network requests (GLA-46)#6
Merged
Conversation
Add schema-inferrer.js that extracts typed schemas from captured network requests. For both request and response sides it produces: - Header schemas: field name, inferred value type (string, integer, number, boolean, empty), and auth flag for Authorization, bearer tokens, x-api-key, cookie, and x-auth-* headers. - Body schemas: recursive type inference (string, number, boolean, null, array, object) for JSON payloads and URL-encoded form data. Arrays unify item schemas across elements; object fields are enumerated with their types. Mixed-type values and optional fields are tracked for future schema merging (GLA-47). Integrates into panel.js: each exported request includes its inferred schema object, and the request detail view renders an "Inferred Schema" section showing the full schema as formatted JSON. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
GLA-46 Schema inference
From a single observation, extract a typed schema for both request and response.
Done when a single request produces a structured schema object. |
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.
Summary
schema-inferrer.jsmodule that extracts typed schemas from a single captured network request, covering both request and response sidesstring,integer,number,boolean,empty), andisAuthflag for auth headers (Authorization, bearer tokens,x-api-key,Cookie,x-auth-*)string,number,boolean,null,array,objectwith named fields) and URL-encoded form data with value coercionmixedtype withvariants) and optional field tracking for future schema merging (GLA-47)schemafield per request) and panel UI (new "Inferred Schema" detail section)Test plan
Authorization: Bearer ...,x-api-key,Cookieheaders should haveisAuth: trueschemaobject withrequest.headers,request.body,response.headers,response.bodymixedtype withvariants🤖 Generated with Claude Code