Allow a more convenient method of working with "x-" specifications
未关闭
还没有人认领这个 Issue。
enhancement
- 主要语言
- PHP
- 星标
- 500
- 派生
- 99
- PR 合并指标
- 30 天内没有已合并 PR
描述
First Point: Excellent project. I've written an OpenApi loader myself. Yours is much better.
Second Point: The openapi specification of keywords allows for the possibility of extending them with the "x-" syntax: https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specification-extensions
In a project I am working on we have made use of this feature. When using cebe/php-openapi I've run into a problem.
- openapi requires the use of the "x-" syntax
- php interprets "x-" not as a variable (or something similar) but sees the "-" as an operation. Particularly with the function isset()
- cebe/php-openapi relies on the native php convention variable/(class attribute names)
- When using isset() to determine if a keyword has been specified PHP reports an error. I have been able to work around this problem by using getSerializableData(). However it would be nice and more convenient if one could access openapi variables (keywords) which use a "-" as part of their name.
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先阅读 issue 中链接的 OpenAPI 扩展规范,以及库现有的 getSerializableData() 行为。跟踪关键字属性是如何暴露的,以及 isset() 是如何用于这些属性的。当调用方能够方便地访问包含连字符的扩展名称而不会出现所报告的 PHP 错误,并且现有的序列化 workaround 仍然得到理解时,即视为完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- openapi, php
- 领域
- api
- Issue 类型
- 功能
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 30/100