Skip to content

Commit b536875

Browse files
captbaritonefacebook-github-bot
authored andcommitted
Handle json schema consts in compiler config doc generation (#5047)
Summary: Fixes #5045. In b208fed we upgraded schemars which changed how the json schema for the compiler config is represented. It looks like the previous representation used enums of a single string literal to represent string literals. The new version uses the [const keyword](https://json-schema.org/understanding-json-schema/reference/const) for string literals. ## Before <img width="800" height="354" alt="Screenshot 2025-08-01 at 9 39 51 AM" src="https://github.com/user-attachments/assets/66c6ca23-7707-47cf-ad4f-f4bb554b8bec" /> ## After <img width="789" height="351" alt="Screenshot 2025-08-01 at 9 39 35 AM" src="https://github.com/user-attachments/assets/36ff9995-09bf-42e9-8cdd-30c5c3633172" /> Related: #5036 Pull Request resolved: #5047 Reviewed By: evanyeung Differential Revision: D79452138 Pulled By: captbaritone fbshipit-source-id: 817ab1f27c5a6c415b9bac1f561291318f069409
1 parent 0d3d84c commit b536875

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

website/src/compiler-config/CompilerConfig.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,9 @@ function T({prop, indirections}) {
357357
case 'number':
358358
case 'boolean':
359359
case 'null':
360+
if (prop.const != null) {
361+
return JSON.stringify(prop.const);
362+
}
360363
return prop.type;
361364
case 'integer':
362365
// TODO: Clarify if this needs to be a unint8

0 commit comments

Comments
 (0)